1
可以说,我有我的ng-repeat
多个过滤器,像这样:角如果异常重复多过滤器是空
input.search(ng-model="filter", placeholder="Search...")
ul.list
li(ng-if="things.length === 0") It looks like we don't have any things.
li(ng-repeat="thing in things | orderBy:'name' | filter: search")
span {{ thing.name }}
现在,如果我最初没有things
,然后我收到消息说如此。但是,如果我过滤了某些不会产生结果的东西,它就不会显示我理解的消息。
我的问题是,如何实现一个多过滤器ng-repeat
并显示一个消息,当收集或过滤器没有产生任何结果?
我正在搞this example无济于事。我尝试:
thing in filteredThings = thing | orderBy: 'name' | filter: search
所以我尝试悲惨地失败了(例如更新)。我尝试了以上,但我得到错误。更大的问题是'filteredThings'从哪里来? 'things'是一个范围集合,'filteredThings'也必须存在吗?或者是在飞行中创建的? – Seth 2015-02-23 22:42:50
@Seth - 它在飞行中创建 - 你得到什么错误? – tymeJV 2015-02-23 23:10:05
我在“ng-repeat”属性之外放置了右括号......宇宙中的一切都很好。谢谢你的帮助! – Seth 2015-02-23 23:35:10