My code is outputting this:
- {"name":"John"}
- {"name":"Mark"}
How can it output this (without editing the $scope.names object):
- John
- Mark
Here's my view:
<body ng-controller="MainCtrl">
<ul>
<li ng-repeat="name in names">
{{name}}
</li>
</ul>
</body>
...and controller:
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.names = {
"1": {
"name": "John"
},
"2": {
"name": "Mark"
}
};
});
Here's my Plunker: http://plnkr.co/edit/hnjoPH0r9xhlvMzO93Ts?p=preview