Angularjs: Displaying array of objects Angularjs: Displaying array of objects json json

Angularjs: Displaying array of objects


If you put data to $rootScope like this:

$rootScope.user = data;

Then you should prefix model in view with $root like this:

<ul id="biometrics" ng-repeat="(property, value) in $root.user[0]">    <li>{{property}}: {{value}}</li></ul>


Try this.

Hope this one will help

     <ul ng-repeat="(key,value) in user[0]">             <li>{{key}} : {{value}}</li>           </ul>  


your data is an array with 1 element (an object literal) and needs to be referenced as an array.

1 quick fix you can do in your $http.success callback:

$rootScope.user = data[0]; /* <-- notice the "[0]" to reference it as an array */

Now you can reference your data in the html like this:

<ul id="biometrics" ng-repeat="info in user">    <li>Age: {{info.age}}</li></ul>