What are the differences between ng-repeat and ng-options and why do they not behave the same way?

后端 未结 5 984
盖世英雄少女心
盖世英雄少女心 2020-11-27 20:31

How do ng-options and ng-repeat differ?

In the following code, I have an ng-repeat that iterates through a list of people:

5条回答
  •  無奈伤痛
    2020-11-27 20:43

    ng-repeat creates a new scope for each iteration so will not perform as well as ng-options.

    For small lists, it will not matter, but larger lists should use ng-options. Apart from that, It provides lot of flexibility in specifying iterator and offers performance benefits over ng-repeat.

提交回复
热议问题