ng-repeat 和 ui-if [英] ng-repeat and ui-if
本文介绍了ng-repeat 和 ui-if的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我想将 ui-if (anguluarUi) 与 ng-repeat 一起使用时(我认为它在那里最有用)我收到一个错误:
错误:多个指令 [uiIf, ngRepeat] 要求嵌入:<!-- uiIf: oConnection.aOptions -->
有没有办法把这两者结合起来?
...不幸的是(目前)不可能.
我知道我可以将 ng-show 和 ng-repeat 结合起来,但它不一样.
我也不想将 ui-if 放在重复之外,因为我想将重复的值用于条件.
解决方案 我认为应该使用过滤器而不是 ui-if.
When I want to use ui-if (anguluarUi) with ng-repeat (and I think it would be most useful there) I Get an error:
Error: Multiple directives [uiIf, ngRepeat] asking for transclusion on: <!-- uiIf: oConnection.aOptions -->
Is there any way to combine those two?
Edit:
<ng-repeat><div ui-if>...
Is not possible (for now) unfortunately.
I know that I can combine ng-show and ng-repeat, but it's not the same.
I also don't want to put the ui-if outside of the repeat, as I want to use the values of the repeat for the condition.
解决方案 I think that a filter should be used instead of ui-if.
这篇关于ng-repeat 和 ui-if的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文