You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding of the resolve plugin is, amongst other things, to be able to pull data from the server and delay the rendering and the execution of the controller until the promise has resolved. That's great and it seems to be something I need. But I have one problem with that. Having code to make a call to a service from the route definition in the app.js seems like a very bad place to do so.
Would there be a way to point the resolve property to some function elsewhere in the code (possibly in the controller itself, as it sounds like the most logical place to put it) ?
The text was updated successfully, but these errors were encountered:
Yes, just create a function in your controlle's file (not in the controller itself) and assign this function to the resolve property of your route. Since you cannot use string arguments, you'll have issues during minification, but you can use $inject to inject parameters to your resolver.
My understanding of the resolve plugin is, amongst other things, to be able to pull data from the server and delay the rendering and the execution of the controller until the promise has resolved. That's great and it seems to be something I need. But I have one problem with that. Having code to make a call to a service from the route definition in the app.js seems like a very bad place to do so.
Would there be a way to point the resolve property to some function elsewhere in the code (possibly in the controller itself, as it sounds like the most logical place to put it) ?
The text was updated successfully, but these errors were encountered: