以 input 標籤爲例
Html:
<input id="maxWatchCount" name="maxWatchCount" ng-model="maxWatchCount_v" style="width: 72%;" class=" margin-lf-2" placeholder="請輸入觀看次數" required="required">
AngularJS:
app.controller('businessCtrl', function($scope, $interval, $http) {
$scope.$watch("maxWatchCount_v", function(n, o) {
//n爲當前控件的狀態(值),o爲當前控件的前一個狀態(值)
......
ni de luo ji cao zuo;
ha ha ha;
......
}, true);
});