Angularjs calls a filter twice with ng-repeat

I am new to angularjs and angularjs trying to learn the concept of filters. But in my case, angularjs calls the filter twice. I expected the filter to only run once, but it runs twice. I canโ€™t understand why this is happening.

here is my plunker ...

+6
source share
1 answer

If I am not mistaken in your question, this is the same question as here

Angularjs takes a dirty check approach, so it needs to call all filters to see if there is any change. After that, it detects a change in one variable (the one you typed), and then runs all the filters again to determine if there are other changes.

To be more clear, fooobar.com/questions/580 / ... will be explained in more detail by an expert in the field of angularjs

Two filters for calling plunker simultaneously

The first call from observers who detect a change. Since there is one, then they need to be called again to find out if there is news, because the observer can make changes.

+6
source

All Articles