Reputation: 9441
I have a basic angular application that I need to do the following:
The directive in question wraps a non-angular Jquery library (galleria.io) and it is crucial to initialize it only after data is obtained. Otherwise, it has to be first initialized with some dummy data and show to viewer some screen "garbage".
Upvotes: 0
Views: 862
Reputation: 320
You should add the HTTP call to a factory, exposing the function, and call this function in the route to this view/controller. This will ensure the promise is resolved before ever loading the view or controller, and its results will be injected into the controller.
See this post for an example: https://stackoverflow.com/a/27239390/1913396
Upvotes: 1