Using $index with the AngularJS 'ng-options' directive?

后端 未结 5 1348
暖寄归人
暖寄归人 2020-12-01 01:37

Say that I bind an array to a select tag using the following:


    selectedItem: {{selectedItem}}

Controller

function MyCtrl($scope) {
    $scope.values = ["Value1","Value2"];
    $scope.selectedItem = 0;
}

Demo Fiddle

Comment:

Array.prototype.indexOf is not supported in IE7 (8)

提交回复
热议问题