Skip to content
Permalink
Browse files

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

* fix(angular): support replaceUrl with angular <7.2

* run linter
  • Loading branch information...
liamdebeasi committed Apr 23, 2019
1 parent 6fbb908 commit eb3cbe45a776eccf3a31685f4541f946564ce066
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 eb3cbe4

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