From f0ccd01f34894d6fa113ca13704bc6fb2d4779e4 Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Wed, 11 Jan 2023 15:35:36 +0100 Subject: [PATCH 1/2] Update uisref on param changing, not only state --- src/directives/uiSref.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/directives/uiSref.ts b/src/directives/uiSref.ts index 3b9055f9..3fa3e6b6 100644 --- a/src/directives/uiSref.ts +++ b/src/directives/uiSref.ts @@ -115,6 +115,7 @@ export class UISref implements OnChanges { /** @internal */ private _emit = false; /** @internal */ private _statesSub: Subscription; + /** @internal */ private _paramsSub: Subscription; /** @internal */ private _router: UIRouter; /** @internal */ private _anchorUISref: AnchorUISref; /** @internal */ private _parent: ParentUIViewInject; @@ -129,6 +130,7 @@ export class UISref implements OnChanges { this._parent = parent; this._statesSub = _router.globals.states$.subscribe(() => this.update()); + this._statesSub = _router.globals.params$.subscribe(() => this.update()); } /** @internal */ @@ -159,6 +161,7 @@ export class UISref implements OnChanges { ngOnDestroy() { this._emit = false; this._statesSub.unsubscribe(); + this._paramsSub.unsubscribe(); this.targetState$.unsubscribe(); } From 0ebf4c1cebd081225911f349cae8bc748d008c06 Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Sat, 14 Jan 2023 19:21:14 +0100 Subject: [PATCH 2/2] Fix typo --- src/directives/uiSref.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directives/uiSref.ts b/src/directives/uiSref.ts index 3fa3e6b6..3296f354 100644 --- a/src/directives/uiSref.ts +++ b/src/directives/uiSref.ts @@ -130,7 +130,7 @@ export class UISref implements OnChanges { this._parent = parent; this._statesSub = _router.globals.states$.subscribe(() => this.update()); - this._statesSub = _router.globals.params$.subscribe(() => this.update()); + this._paramsSub = _router.globals.params$.subscribe(() => this.update()); } /** @internal */