Difference between ng-bind and interpolation {{}} in Angular

后端 未结 9 1352
独厮守ぢ
独厮守ぢ 2020-12-03 02:05

Is there any difference between {{ }} and ng-bind in angular.

I am quite new to Angular. I started with using {{ }} and then in the documentation i find ng-bind. I

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 02:28

    In addition to the above mentioned answers,

    Performance Issues with Interpolation:

    As explained in this thread better,

    ng-bind is a directive and will place a watcher on the passed variable. So the ng-bind will only apply when the passed value does actually change.

    The brackets on the other hand will be dirty checked and refreshed in every $digest, even if it's not necessary.

提交回复
热议问题