【发布时间】:2016-05-04 01:10:57
【问题描述】:
http://plnkr.co/edit/0CAgXsX847n9LfIG4Fzj?p=preview
我有两个文件: -index.html(这使用 ng-include - 不工作) -index_embedded.html(使用相同的代码但不使用包含 - WORKS)
您好,我的问题是当我点击“CLICK ME”,然后点击“CLOSE”,然后再次尝试点击“CLICK ME”时,它不再起作用。
当我使用相同的代码而不使用 ng-include 时,我可以点击“CLICK ME”、“CLOSE”,然后再次点击“CLICK ME”。
为什么只有当代码在包含文件中时这不起作用?
<h2 ng-click="asdf = !asdf">CLICK ME</h2>
<!-- <div ng-include="'partials/audiencenav.html'"></div> -->
<!-- extracted code from the include and pasted below, i'm able to successfully CLICK, CLOSE, and CLICK again -->
<div class="" ng-show="asdf">
<div ng-click="asdf = !asdf"><h2>CLOSE</h2></div>
</div>
问题是当代码被放置在包含文件中时,它会在点击“CLOSE”后中断。
【问题讨论】:
标签: angularjs partials ng-show angularjs-ng-include