-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(state): add $stateResolved event #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
$stateResolved fires after state resolved with possibility to prevent event. Such functionality is useful for login system, when we need get current user first, and then, based on response, redirect to login page or continue.
Hey I like this too! |
Again you'd need to add some ngdocs for it though. Thanks! |
Cool. I was wating for the feedback, because i probably need to add some tests as well |
Ah yes you do. I like this because it solves some other problems we were having. It's kind of like a simple short term (maybe long term) solution to this issue: #618 |
Why not just use the resolve system and check for the $stateChangeError that's fired ? |
I have extracted this from one of my app. |
@Timsly http://plnkr.co/edit/JwmJmj0FmXmxs7razEcd?p=catalogue |
@marcghorayeb mine is different, but goal is the same |
I like the idea, but we're getting up to quite a few events here. What's the performance impact of this? |
@nateabele i extracted this event from my app. My goal was to wait for all resolves and than take decision either show login form and stop loading process(prevent event) or continue normal loading process. |
I like having a separate event, because resolving of states really is a very important "event" that takes places, and it has nothing to do with errors necessarily. |
After careful consideration, I've decided against this. The need for it is a symptom of |
$stateResolved fires after state resolved with possibility to prevent event.
Such functionality is useful for login system, when we need get current user first,
and then, based on response, redirect to login page or continue.