Skip to content

Suppressing the reloading/recreation of controllers and views upon query string parameter changes #1038

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

Closed
cbayram opened this issue Apr 22, 2014 · 1 comment

Comments

@cbayram
Copy link

cbayram commented Apr 22, 2014

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 goal is to be able to perform UI animations, react to $stateParams changes and maintain state in the url. I've created a pull requests #1037 and would love your feedback.

I've tried to avoid breaking existing functionality and resorted to creating two new configuration variables.

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()).

nateabele added a commit that referenced this issue Apr 22, 2014
`$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 #1037, #1038, #64
@IGx89
Copy link

IGx89 commented Jul 10, 2014

@nateabele, has your dynamic-params branch been merged into master yet? If not, do you know when that'll happen?

nateabele added a commit to nateabele/ui-router that referenced this issue Aug 22, 2014
`$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 added a commit to nateabele/ui-router that referenced this issue Sep 9, 2014
`$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
gGonz pushed a commit to gGonz/ui-router that referenced this issue Mar 13, 2015
`$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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants