-
Notifications
You must be signed in to change notification settings - Fork 3k
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
1.0.0alpha0: $stateParams isn't updated when URL changes and reloadOnSearch:false #2470
Comments
Are you talking about the global |
(Also, 1.0 uses a totally different model for handling dynamic parameters than 0.2.x). |
I've put together a demo here: https://plnkr.co/edit/R04QVFMWEqKZhFBHMuWz?p=preview
|
Yeah, it's a known issue. We're still working on a way to propagate changes to those objects. Thanks for flagging it. |
Also it has another side effect, let's consider the following
as result we lost someParams or vice versa
as result someParams is here again Is this the same issue or this issue requires separate ticket? |
is this confirmed as fixed? |
@mackelito yes https://plnkr.co/edit/XiyY4VoBdJ0MzGQ3cCP6?p=preview
This confusing behavior (of a different object being injected into a controller then a global service) is why it is now deprecated. Instead we recommend using |
@christopherthielen I see.. I there any docs on how to use |
There isn't a guide or tutorial specifically about A transition is the process of activating a ui-router state using the desired parameters. The short version of how to use |
hmm.. so I should us it in my component like this? class PageController {
constructor($transition$) {
'ngInject';
console.log($transition$);
}
}
export default PageController; or should I use it in resolve: on the state? |
When using route-to-component.state('foo', {
component: 'fooComponent'
}) .component('fooComponent', {
template: `<h1>{{ $ctrl.params }}</h1>`,
controller: function() { this.params = this.$transition$.params(); }
bindings: { $transition$: '<' }
}) Route-to-component (as resolve).state('foo', {
component: 'fooComponent',
resolve: { params: ($transition$) => $transition$.params() }
}) .component('fooComponent', {
template: `<h1>{{ $ctrl.params }}</h1>`,
bindings: { params: '<' }
}) old school template+controller.state('foo', {
template: `<h1>{{ $ctrl.params }}</h1>`,
controller: function($transition$) {
this.params = $transition$.params();
},
controllerAs: '$ctrl',
}) |
Maybe #1962 needs to be applied to the 1.0 branch?The text was updated successfully, but these errors were encountered: