Skip to content

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

Closed
wants to merge 3 commits into from
Closed

Conversation

cbayram
Copy link

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

cbayram added 3 commits April 21, 2014 19:23
…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.
@nateabele
Copy link
Contributor

Thanks for the PR, but this functionality is already in progress under a different approach.

@cbayram
Copy link
Author

cbayram commented Apr 22, 2014

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?

nateabele added a commit that referenced this pull request 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
@nateabele
Copy link
Contributor

@cbayram Yup, see 7a82df7 on the dynamic-params branch.

@nateabele nateabele closed this Apr 22, 2014
nateabele added a commit to nateabele/ui-router that referenced this pull request 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 pull request 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
@cwmrowe
Copy link
Contributor

cwmrowe commented Jan 2, 2015

@nateabele I'm very keen to use the functionality you added in the dynamic-params branch back in April 2014, but am apprehensive has it hasn't been added to a release yet. Are you aware of any reasons why it hasn't been included yet?

gGonz pushed a commit to gGonz/ui-router that referenced this pull request 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

Successfully merging this pull request may close these issues.

3 participants