Sorry, the link I wanted to add is https://groups.google.com/d/msg/angular/-/IxomUg31eiQJ. Here is desribed why returning a (new) promise from a filter leeds to an infinite loop...
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
That is exactly what I am trying to do. The service sends a http-request to optain the dictionary. But since this is async I just get a promise. I do cache this promise inside the service and each time the filter asks for it, the service returns this (most of the time already resolved) promise. But I cannot use this promise inside the filter (as described above). And I am also not able to wait for the http-request to return...
First: thank you very much for your very fast reply!
I use the same dictionary object (response of the http-request) to populate the options of a selelect-box. When I handle it the way you suggested, the select-box stays empty since at the time the property is read, it is still undefined... That's the reason why I think I have to return a promise from my service. Then I could satisfy the select-box-options-binding, but not the filter, and vice versa.