I have 2 states in coffeescript ...
stateProvider.state 'test', ... resolve: user: (LongRunning)-> LongRunning.authenticate().then -> console.log("We are authenticated!") stateProvider.state 'test.child', ... resolve: other: (AfterAuth)-> AfterAuth.soSomethingWithAuth().then -> console.log("We are done!")
Of course, this does not work, because the resolution of the child element is started before the parent auth method is resolved. This means that the second function will not be authenticated and will cause the entire state to fail.
Now it does not have to be part of the State path, but it must be completely completed by the time the permission functions are called.
How can I make sure that the function from the parent is fully resolved before the method is called in the child?
Bad (?) Solution
One answer I could come up with was to use a manual boot process. However, this is tiring, since I will need to reinstall all my services. Anyway, can I do this inside Angular?
angularjs coffeescript angular-ui-router angular-ui
Jackie
source share