javascript - Using ng-repeat on a position of $scope -


i have array like:

$scope.items = []; $scope.items[0] = {val1: 1, val2: 2} 

i'm trying use ng-repeat like:

<div ng-repeat = "item in items[0]"> {{item.val1}} </div> 

which right way use this? :d !

items[0] not array object need use (key, value) in expression notation (see docs) iterate on object properties:

<div ng-repeat="(key, value) in items[0]">{{key}} {{value}}</div> 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -