-
Notifications
You must be signed in to change notification settings - Fork 9
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
When using RouteProvider separately to the StateProvider, state not updated on route param change #128
Comments
…t so STATE_CHANGE is fired on reload optional.
There is still a piece missing in this on for it to work with no routes on the state at all. But for the more conceptual part, I would still recommend giving a route to an actual state... Which will act as a main route for that state... Reason being that it enables URL generation for states... You can still add additional routes pointing to the state after that. So in essence you would have: $stateProvider.state('contact', {
route: '/contacts/:contactId',
views: {
'main': {
template: 'contact.html',
controller: 'contactController'
}
},
})
$routeProvider.when('/anotherurl/:contactId', { state: 'contact') }) |
and Example: http://plnkr.co/edit/UtuBVXrr89cizzqz4IFU?p=preview |
When defining a state independently of the route e.g. define the state with the $stateProvider, then map the route to the state using the $routeProvider, the state is not correctly reloaded when one of the route params changes e,g
I would expect that when the 'contactId' changes, the state should be reloaded, as it is when you declare the route on the state itself...
The reason I am declaring the routes using the routeProvider is so that we can map 1 or more routes to the same state. If there is another way of doing this, perhaps the above issue would not need solving?
The text was updated successfully, but these errors were encountered: