I populate a JSON data array with human-related data, for example.
$scope.persons = [{ firstname: '', surname: ''}];
$scope.persons.push({
firstname: $scope.firstname,
surname: $scope.surname
});
Then I try to output all array elements in HTML as follows:
<span ng-repeat="person in persons">{{person.firstname}} {{person.surname}}</span>
What I get is an empty pair of tags <SPAN>as output, always at the right amount, means: three names in the array lead to three pairs of tags <SPAN>, but there is no user data inside it ?! Why?
source
share