I am new to Angularjs and having trouble displaying data . i.e. Json array
This is the result of my rest service call:
{"users":[{"id":1,"firstname":"Naveen","lastname":"Dutt","email":"[email protected]","telephone":"7829418456445355"}]}
And this is my controller:
app.controller('MyCtrl2', ['$scope', 'NFactory', function ($scope, NFactory) {
alert("here??");
$scope.bla = NFactory.query;
alert("here??" + $scope.bla);
NFactory.get({}, function (nFactory) {
$scope.allposts = nFactory.firstname;
})
}]);
This is my html:
<div>
<ul >
<li ng-repeat="user in bla"> {{ user.firstname }} </li>
</ul>
</div>
but it doesnt show anything on UI. what can be the problem? please suggest.
{{bla}}
, just to see what the hell was in there. – domokun Mar 5 at 9:24