I've noticed that if I call functions from my angular view, the functions are called a lot. Also when the data hasn't changed.
For example:
<div ng-repeat="day in days_array">
{{getWeek(day)}}
</div>
Then getWeek() gets called for all the items in days_array every time almost anything in the application changes. So I wondered if this is what filters are solving? So filters are only called when days_array is actually changed, and therefore gives better performance?
{{::getWeek(day)}}, or better yet, add the week as a property to the day when the data is fetched.ng-repeat="day in ::days_array"If you're fetching data from server, just set days_array to undefined, so it just gets evaluated when its realy filled