ng-repeat vs ng-options which is best for me

后端 未结 3 1346
闹比i
闹比i 2021-01-14 12:42

i have to display the JSON data in drop down list ,for that i have two options one of the options is By using ng-repeat and other one is ng-options.

ng-repeat code :

3条回答
  •  时光说笑
    2021-01-14 13:06

    I think that ng-options, because that is meant to be used in cases like this.

    Angularjs Docs:-

    ngOptions provides an iterator facility for the element which should be used instead of ngRepeat when you want the select model to be bound to a non-string value. This is because an option element can only be bound to string values at present.

提交回复
热议问题