AngularJS : Why ng-bind is better than {{}} in angular?

前端 未结 12 686
灰色年华
灰色年华 2020-11-22 07:19

I was in one of the angular presentation and one of the person in the meeting mentioned ng-bind is better than {{}} binding.

One of the re

12条回答
  •  渐次进展
    2020-11-22 07:24

    {{...}} is meant two-way data binding. But, ng-bind is actually meant for one-way data binding.

    Using ng-bind will reduce the number of watchers in your page. Hence ng-bind will be faster than {{...}}. So, if you only want to display a value and its updates, and do not want to reflect its change from UI back to the controller, then go for ng-bind. This will increase the page performance and reduce the page load time.

    Hello,

提交回复
热议问题