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

后端 未结 3 1350
闹比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:02

    As far as performance is regarded, I think you should use your own directive that will handle it.

    ng-options puts every element in $watch => gets really slow if the list contains hundreds elements

    ng-repeat will be slow to be rendered.

    You should then prefer using your own directive, and build your html into it

提交回复
热议问题