jjzjj

bindToController

全部标签

javascript - AngularJS 1.4 指令 : scope, 两种方式绑定(bind)和 bindToController

Update:Itmusthavebeensomethingstupidinanotherpartofthecode.Itworksnow,sothebindToControllersyntaxisfine.我们正在使用AngularJS1.4,它引入了一个newwaytousebindToController在指令中。经过相当多的阅读(也许还没有完全理解),我们这样定义了我们的指令:.directive('mdAddress',functionmdAddress(){vardirective={restrict:'EA',scope:{},bindToController:{addr