通过$watch来观察input中的数据
index.html
<input ng-model='value'></input>
script.js
(一)
app.controller('myCtrl',function($scope){
$scope.$watch('value',function(){}){
console.log($scope.value);
}
})
(二)
app.controller('myCtrl',function($scope){
$scope.$watch('value',function(newValue,oldValue){
console.log(newValue);
console.log(oldValue);
})
})