Hello!
You must iterate the
$scope.drinks.recipes
The $scope.drinks.recipes.recipe is a single recipe, which may be undefined
(because recipes is an array). You should do something like this:
<div ng-repeat="recipe in drinks.recipes">
<div>Name: {{ recipe.attributes.name }}</div>
</div>
El miércoles, 13 de enero de 2016, 8:47:08 (UTC-3), Emmy escribió:
>
> Hey guys, i need your help.
>
> I am using this API:
> http://www.cocktailberater.de/website/recipe?format=json and I need the
> attribute rsp.recipes.recipe --> "name"
>
> How can I reach it using <ng-repeat>
>
> *HTML-File*
> <div ng-repeat="drink in drinks">
> <p ng-bind="drink.status"></p>
> <div ng-repeat="anzahl in anzahlen">
> <p ng-bind="anzahl.count"></p>
> <div ng-repeat="recipename in recipenames">
> <p ng-bind="recipename.name"></p>
> </div>
> </div>
> </div>
>
>
>
>
> *JAVASCRIPT*
>
>
>
> *app.controller ('ListCtrl', function ($scope, $rootScope, $http,
> extDaten) { var
> url='http://www.cocktailberater.de/website/recipe?format=json
> <http://www.cocktailberater.de/website/recipe?format=json>';
> $rootScope.fullData.success(function(data){ $scope.drinks = data.rsp;
> $scope.anzahlen = $scope.drinks.recipes; $scope.recipenames =
> $scope.anzahlen.recipe; }) });*
>
>
>
> *This Code shows the status "ok" and the number of recipes "65", but no
> recipe name*
> *I think I have not unterstand yet, how to handle the array in that json
> file*
>
--
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.