AngularJS -监视指令控制器的作用域

AngularJS - watching the scope of directive's controller

本文关键字:作用域 指令控制器 监视 AngularJS      更新时间:2023-09-26

我已经建立了一个柱塞来测试,但我一定不理解一些角度的基本原理。

为什么指令的link函数不能在指令的控制器作用域中监视属性(scope. featureattributes)

http://plnkr.co/edit/rWG5NEp6TRYfP7l1HHDw

谢谢你的帮助

您使用$watchCollection。plnkr包含Angular 1.0.8。后来的版本引入了$watchCollection