In my JSON object, I have a list of "items" that I want to display in a dropdown menu. However, when using ng-repeat, the dropdown list is appearing blank.
To see the code I've used, you can visit this link.
HTML:
<div ng-controller="Ctrl">
<div ng-repeat="item in items">
<select ng-model="item.shareToOption" ng-options="c.value for c in shareToOptions"></select>
</div>
</div>
JS:
var app = angular.module('app', []);
function Ctrl($scope) {
$scope.items = [
{ "shareToOption" : {id:1,value:"AA1"} },
{ "shareToOption" : {id:2,value:"AA2"} },
{ "shareToOption" : {id:3,value:"AA3"} },
{ "shareToOption" : {id:4,value:"AA4"} }
];
$scope.shareToOptions = [
{id:1,value:"AA1"},
{id:2,value:"AA2"},
{id:3,value:"AA3"},
{id:4,value:"AA4"},
{id:4,value:"AA5"},
{id:4,value:"AA6"},
{id:4,value:"AA7"}
];
}