观看多个$ scope属性

观看多个$ scope属性,第1张

观看多个$ scope属性

从AngularJS
1.3开始,有一个新方法称为

$watchGroup
观察一组表达式

$scope.foo = 'foo';$scope.bar = 'bar';$scope.$watchGroup(['foo', 'bar'], function(newValues, oldValues, scope) {  // newValues array contains the current values of the watch expressions  // with the indexes matching those of the watchexpression array  // i.e.  // newValues[0] -> $scope.foo   // and   // newValues[1] -> $scope.bar });


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5042023.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-15
下一篇 2022-11-15

发表评论

登录后才能评论

评论列表(0条)

保存