Why does `filter` trigger some many times?

angularjs

Solution

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.

Problem

http://plnkr.co/edit/b1yGAwkzojF4BFWgpMsv?p=preview 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?

Original source

Related problems