-
Notifications
You must be signed in to change notification settings - Fork 3k
Reduce Providers Needed for States #184
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
Comments
It would be an impedance mismatch. The focal point of the state machine is states, and those methods all have to do with URLs. What I will say is that all good state machines provide opportunities that allow easy recovery from situations which would otherwise leave the state machine in an inconsistent state. That being said, I only ever use |
$stateProvider/$state are enough for me with the addition of aliases and "otherwise", which is what I did for detour. |
Alright. I'll def defer to your two opinions on this since you've both used it more than me. This is probably a confusion that stems from the various providers used in the example, which we all know needs to be redone as a more real world example. Just need one of us to find the time :) |
I think this issue is so close to #185 that we might as well pick one of them and concentrate our focus there -- so see #185 for my response... but here's a hint: I'll raise you one deferral and defer to @ksperling! |
On some of these things it would be really good to get some feedback from people who've written reasonably large apps with ui-router in anger... I generally prefer 2 clean APIs that are orthogonal to one mixed thing that appears convenient but isn't very clear on what it does. It think with the '' -> '/' fix and maybe alias URLs there shouldn't be much reason to use $urlRouterProvider directly in most cases. |
I've tried writing code in anger before and it feels good at first but never seems ti work properly the day after!!! ;) |
I'm guessing we can close this? If an app isn't using the compatibility shim, they only ever need two providers, which seems like a perfectly appropriate thing to me. |
Sure, I think the docs have been enhanced since then as well and we've gotten almost no questions on this. |
Goes along with idea of recuuding complexity, see #174.
Too many providers! stateProvider, urlProvider, urlRouteProvider, routeProvider, abcProvider, xyzProvider and whatever other providers we make people use. It's madness! I feel like we shouldn't have to use anything other than stateProvider, even if it means adding proxy methods onto stateProvider that just call methods on other providers.
Is there anything wrong with adding .when(), .otherwise(), .redirect(), etc straight to stateProvider?
The text was updated successfully, but these errors were encountered: