Hi Sander,

The URLs return JSON - just displaying as raw JSON is find for this example.

I've tried this (thanks) and several variants. Unfortunately it's freaking
out Angular and locking up Chrome because of an "*10 $digest() iterations
reached. Aborting!*" error (like this:
http://stackoverflow.com/questions/14376879/error-10-digest-iterations-reached-aborting-with-dynamic-sortby-predicate
).

Any other thoughts? It seems to me this has to be a very common scenario.
If the Angular Tutorial's main list of phones included the data from the
individual phone.json URL files, this is is exactly my situation.

D.


On Mon, Jun 16, 2014 at 12:02 AM, Sander Elias <[email protected]>
wrote:

> Hi David,
>
> Well, I have no idea what those url’s return. That makes it hard to give a
> complete solution to your problem.
>
> <div ng-repeat="room in rooms">
>     <h1>
>         {{ room.room }}
>         <span class="floor pull-right">{{ room.floor }}</span>
>     </h1>
>     <div ng-repeat="api_endpoint in room.api_endpoints" ng-init='data= 
> {url:api_endpoint}'>
>         <h2>
>             {{resolve(data) ; data.data|json}}
>         </h2>
>     </div>
> </div>
>
> in your controller you can do this:
>
> $scope.resolve = function(data) {
>     $http.get(data.url).success(function (incoming) {
>         data.data = incoming;
>     });
> };
>
> It is good to note you should move the to an service, if it becomes any
> more complex than this.
> If you have control over the back-end/server that is giving you the data,
> you might consider
> it to generate html partials, that you can simply include using ng-include.
>
> Regards
> Sander
> ​
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/hyiN-DvsCTA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to