Two-way binding, generally speaking is like this
<input ng-model="object.xxx">
<span ng-bind="object.xxx"></span>
In other words, ng-bind is equivalent to {{object.xxx}}
, which is used to display data. And ng-model controls data.
But here, after I get the device number from the background, I output it to the page. I use ng-model for input, but there is no response when using ng-bind. Why?
http://stackoverflow.com/a/12420157/2586541
How did you obtain the device number?
If you implement ajax yourself, you need to manually $scope.$apply();
after getting the data If $http is used to obtain data, angular will automatically call $apply().
ng-bind is a one-way binding from $scope -> view
ng-modle is a two-way binding from $scope <-> view