$swatch Monitoring method
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<script src= ". /angular-1.5.5/angular.min.js "></script>
<body ng-app= "MYAPP" >//Ng-app indicates the scope of the action
<div ng-controller= "CTRL" >//Create Controller
{{Age}}
<p>{{oldValue}}</p>
<p>{{intro}}</p>
<textarea name= "" id= "" cols= "" rows= "ng-model=" Intro "></textarea>
</div>
</body>
<script>
var app= angular.module ("myApp", [])//
Create Modle (module)
App.controller ("Ctrl", function ($scope) {
$scope. age= "17";
$scope. intro= "Huan Yi ang 1111";
$scope. $watch ("Intro", Function (newvalue,oldvalue) {//oldvalue mewvalue new data for the previous data after the change
$scope. Oldvalue=oldvalue
});
SetInterval (function () {
$scope. $apply (function () {
Because setinterval cannot trigger a dirty check mechanism to use the $apply method
$scope. age++;
})
},1000)
});
$apply method (trigger dirty check mechanism)