-3
{"id":1,"firstName":"John1","lastName":"Doe1","**accountIds**":[12345,12346,12347],"recipients":[{"accountNumber":22222,"firstName":"Mary1","lastName":"Jane1"},{"accountNumber":33333,"firstName":"Mary2","lastName":"Jane2"}]}

display "accountIds" is dropdown list.

Rajesh Kumar
  • 153
  • 2
  • 4
  • 13

1 Answers1

0

Please see jsfiddle attached http://jsfiddle.net/HB7LU/13213/.

You need to target the accountIds by using dot notation.

HTML

<div ng-controller="MyCtrl">
    <select>
        <option ng-repeat="item in items.accountIds">{{item}}</option>
    </select>
</div>

JS/Angular

var myApp = angular.module('myApp', []);

function MyCtrl($scope) {
    $scope.items = {
        "id": 1,
        "firstName": "John1",
        "lastName": "Doe1",
        "accountIds": [12345, 12346, 12347],
        "recipients": [{
            "accountNumber": 22222,
            "firstName": "Mary1",
            "lastName": "Jane1"
        }, {
            "accountNumber": 33333,
            "firstName": "Mary2",
            "lastName": "Jane2"
        }]
    }
}
Paul Fitzgerald
  • 11,770
  • 4
  • 42
  • 54