1、监听一个一个变量的值的变化
...
$scope.storeIns = null; //storeIns定义在$scope下
...
$scope.$watch('storeIns', (n, o) => { //storeIns为变量名称 n为变化后的值;o为变化前的值 //todo something })
2、监听多个变量的值
$scope.$watchGroup(['createDate','source'],function(n,o){ //... });
1、监听一个一个变量的值的变化
...
$scope.storeIns = null; //storeIns定义在$scope下
...
$scope.$watch('storeIns', (n, o) => { //storeIns为变量名称 n为变化后的值;o为变化前的值 //todo something })
2、监听多个变量的值
$scope.$watchGroup(['createDate','source'],function(n,o){ //... });
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。