ng-model和ng-bind区别

ng-bind has one-way data binding ($scope --> view). It has a shortcut {{ val }} which displays the scope value $scope.val inserted into html where val is a variable name.

ng-model is intended to be put inside of form elements and has two-way data binding ($scope --> view and view --> $scope) e.g. <input ng-model="val"/>.

posted @ 2016-07-28 10:42  zouminglan  阅读(578)  评论(0编辑  收藏  举报