One of our requirements is having to redirect to a certain url from within an onEnter
hook in one of my states. I have the following code:
It seems that is not working properly in most cases (I'm really sorry that I can't replicate what I have in this project in a repro repo):
After this final log, the app hangs in that state, and no transitions are made to the url I specify in urlService.url(...)
call.
My question is, what is the proper way to redirect to another url (the url of course will be a match in one of my states) inside the onEnter
hook. I know that the proper way would have been to return a redirect target, but as I only have a raw url, I have no idea how to do that.
The problem was because of redirecting to other state first (to handle, loading, etc) on page load before redirecting back. This pattern isn't very compatible with how ui-router works. After I handled the loading functionality without redirecting to states initially, everything worked as expected.