How to 'unwatch' an expression

前端 未结 5 517
情深已故
情深已故 2020-11-30 19:21

Say I have an ng-repeat with a big array.

When ng-repeat runs, it adds every element of that array to an isolated scope, as well as having the array itself in a scop

5条回答
  •  执笔经年
    2020-11-30 19:31

    If you are using angularjs 1.3 or above, you can use the single bind syntax as

  • {{item}}
  • This will bind the value and will remove the watchers once the first digest cycle is run and the value changes from undefined to defined for the first time.

    A very helpful BLOG on this.

提交回复
热议问题