$watch方法
var firstController = function ($scope){$scope.name='張三';$scope.data={name:'李四',count:20}$scope.count=0;$scope.$watch('name',function (newValue,oldValue) {++$scope.count;if($scope.count>30){$scope.name='已經大于30次';}});$scope.$watch('data',function () {},true)}
轉載于:https://www.cnblogs.com/zhuj/p/7677041.html
總結
- 上一篇: join()方法
- 下一篇: [慕课笔记] node+mongodb建