Skip to content
Permalink
Browse files

fix(angular): support replaceUrl with angular <7.2 (#18107)

  • Loading branch information...
liamdebeasi committed Apr 23, 2019
1 parent fdd2978 commit 26ca72ccc99cbce240b21e1752c74b9c33f98301
Showing with 16 additions and 1 deletion.
  1. +16 −1 angular/src/directives/navigation/stack-controller.ts
@@ -59,7 +59,22 @@ export class StackController {
}
const viewsSnapshot = this.views.slice();

const currentNavigation = this.router.getCurrentNavigation();
let currentNavigation;

const router = (this.router as any);

// Angular >= 7.2.0
if (router.getCurrentNavigation) {
currentNavigation = router.getCurrentNavigation();

// Angular < 7.2.0
} else if (
router.navigations &&
router.navigations.value
) {
currentNavigation = router.navigations.value;
}

/**
* If the navigation action
* sets `replaceUrl: true`

0 comments on commit 26ca72c

Please sign in to comment.
You can’t perform that action at this time.