【发布时间】:2016-05-24 17:38:35
【问题描述】:
我创建了一个自定义指令,在当前视图中显示指令模板:
<div class="upper-outfits-layer" ng-show="outfitExpanded">
<expanded-outfit outfit="outfits[currentOutfit]"></expanded-outfit>
</div>
这将显示一个 html 模板。放置此指令的视图具有自己的控制器。我需要从此指令访问视图范围变量,反之亦然。
是否可以通过自定义指令访问单独的控制器?
【问题讨论】:
标签: angularjs model-view-controller angularjs-directive