what is the difference between ng-bind vs one time binding in angular

前端 未结 5 723
执笔经年
执笔经年 2020-12-02 17:17

What is the difference between \"ng-bind\" and \"one time binding\" in angular js.

If there is any difference, where should I be using each of them?

5条回答
  •  囚心锁ツ
    2020-12-02 18:12

    In simple way,i understood like this,

    Two way Data-binding - ng-model

    Links both the {{}}(in the HTML) and $scope (in the controller) of the variable and updates the value of the variable if any of the changes happen.

    One way Data-binding - ng-bind

    Links only from $scope to the {{}}, but not vice versa.

提交回复
热议问题