小编Zac*_*ach的帖子

angularjs $ watchGroup以控制器作为语法

基于我最近阅读的一堆Angular JS样式指南,似乎有几个原因,首选Angular JS控制器的'controller as'语法.

我已经看到了如何注入$ scope以便使用$ watch,$ on等特殊方法的示例.

下面的示例显示了如何使用'controller as'语法成功使用$ watch:

$scope.$watch(angular.bind(this, function () { 
    return this.name;
}), function(value) {
    console.log('Name change to ' + value);
});
Run Code Online (Sandbox Code Playgroud)

我没有找到任何地方是如何使用这种类似的方法使用$ watchGroup.有谁知道如何做到这一点?

angularjs angularjs-scope

6
推荐指数
1
解决办法
1701
查看次数

标签 统计

angularjs ×1

angularjs-scope ×1