我试图在AngularJS应用程序中使用ng-重复中的wj-弹出,但遇到了困难。
基本上,我使用了wj弹出窗口的演示示例,并将其包装为ng-重复,如下所示。我有一个帖子数组,每个帖子都有一个属性indexValue (post.indexValue)。
每个按钮都需要一个不同的ID,所以我希望使用post.indexValue应该可以工作,并且它确实正确地设置了每个重复的按钮ID,但是调用函数没有工作,弹出窗口也没有出现,我也不知道我做错了什么。
<div ng-repeat="post in posts">
Click to open, move focus away to close:
<button id="{{post.indexValue}}" type="button" class="btn">
Click
</button>
<wj-popup class="popover" owner="#{{post.indexValue}}" show-trigger="Click" hide-trigger="Blur">
<ng-include src="'includes/popup.htm'"></ng-include>
</wj-popup>
</div>发布于 2016-05-15 09:36:11
问题是身份证。即使没有ng-重复和所有者id以任何数字开头,弹出也无法工作。将按钮id更改为“btn{{post.indexValue}”对我有效。试试这个小提琴。
<div ng-repeat="post in posts">
Click to open, move focus away to close:
<button id="btn{{post.indexValue}}" type="button" class="btn">
Click
</button>
<wj-popup class="popover" owner="#btn{{post.indexValue}}" show-trigger="Click" hide-trigger="Blur">
<ng-include src="'includes/popup.htm'"></ng-include>
</wj-popup>
</div>https://stackoverflow.com/questions/37232224
复制相似问题