ng-include作为模态第一参考工作,第二参考失败

时间:2013-07-12 16:40:49

标签: angularjs

我的Plunker:http://plnkr.co/edit/xrzhG9NqYfv2Mbskbh1D?p=preview

在坚果壳中,我的index.html

中列出了下面的代码
<div data-ng-controller="addCtrl" data-ng-include="'app/views/add.html'" />   
<div data-ng-controller="editCtrl" data-ng-include="'app/views/edit.html'" />

我有两个按钮,一个显示add.html,另一个通过$broadcast显示 使用当前订单,添加工作,但编辑不。如果我翻转订单,例如:

<div data-ng-controller="editCtrl" data-ng-include="'app/views/edit.html'" />
<div data-ng-controller="addCtrl" data-ng-include="'app/views/add.html'" />  

然后编辑工作,但添加没有。 这可能与我之前的问题搞砸了,但不确定:"Element is not currently visible and so may not be interacted with" but another is?

1 个答案:

答案 0 :(得分:2)

似乎角度不能用<div />符号表示。

扩展为<div ...></div>