-
Notifications
You must be signed in to change notification settings - Fork 3k
Adding 'reloadOnPath' and 'reloadOnQuery' configuration to the state. #1037
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
…ameter is 'path' or 'query'
…rations to permit url changes without controller and/or view reloads. Useful when you want reflect changes in the $stateParams and url without having to recreate/reload controllers and views.
…ery' state configurations
Thanks for the PR, but this functionality is already in progress under a different approach. |
Thanks @nateabele. This is good news, I'll be looking forward to the patch. Is there a link where I can track the release of this feature so I can incorporate it when it's completed and released? |
`$stateParams` is now a service with an `$observe()` method to watch parameters on dynamic state parameters. Dynamic state parameters can be declared like so: `params: { foo: { dynamic: true } }`. Closes angular-ui#1037, angular-ui#1038, angular-ui#64
`$stateParams` is now a service with an `$observe()` method to watch parameters on dynamic state parameters. Dynamic state parameters can be declared like so: `params: { foo: { dynamic: true } }`. Closes angular-ui#1037, angular-ui#1038, angular-ui#64
@nateabele I'm very keen to use the functionality you added in the |
`$stateParams` is now a service with an `$observe()` method to watch parameters on dynamic state parameters. Dynamic state parameters can be declared like so: `params: { foo: { dynamic: true } }`. Closes angular-ui#1037, angular-ui#1038, angular-ui#64
The reloading and recreation of the controllers and views when modifying search parameters prohibits any smooth UI as the DOM as well as scopes are discarded. The current 'reloadOnSearch' stops the transition, however it fails to update the $location.search(), more importantly, it fails to reflect the changes to the $stateParams which applications rely on for reactive code ($watch).
The configuration of 'reloadOnPath' and/or 'reloadOnQuery' being set to 'false' will update the url, update the $stateParams and suppress the reloading of the controllers and views. One can specify the same configurations when using $state.transitionTo() as well as other wrappers around it ($state.go()).