为什么`filter`引发一些多少次? [英] Why does `filter` trigger some many times?
本文介绍了为什么`filter`引发一些多少次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
http://plnkr.co/edit/b1yGAwkzojF4BFWgpMsv?p=$p$ PVIEW
为什么过滤器
引发一些多少次?
Why did filter
trigger some many times?
我猜 {{名称|测试}}
,因为名称空
在第一,然后将跳跳虎两次在得到了控制值。
I guess {{name|test}}
will tigger twice because the name is null
at first, then got value at controller.
为什么触发过滤
时包含模板?
Why did it trigger filter
when include template?
推荐答案
每个过滤器被称为至少每消化周期。 这SO回答有演示此小提琴。
Every filter is called at least once every digest cycle. This SO answer has a fiddle that demonstrates this.
当模板被加载时,你是在消化周期,因此所有的过滤器将被调用。
When a template is loaded, you are in a digest cycle, so all filters will be called.
这篇关于为什么`filter`引发一些多少次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文