()
| 83 | } |
| 84 | |
| 85 | private createScrollEvents() { |
| 86 | return this.transitions.events.subscribe((e) => { |
| 87 | if (e instanceof NavigationStart) { |
| 88 | // store the scroll position of the current stable navigations. |
| 89 | this.store[this.lastId] = this.viewportScroller.getScrollPosition(); |
| 90 | this.lastSource = e.navigationTrigger; |
| 91 | this.restoredId = e.restoredState ? e.restoredState.navigationId : 0; |
| 92 | } else if (e instanceof NavigationEnd) { |
| 93 | this.lastId = e.id; |
| 94 | this.scheduleScrollEvent(e, this.urlSerializer.parse(e.urlAfterRedirects).fragment); |
| 95 | } else if ( |
| 96 | e instanceof NavigationSkipped && |
| 97 | e.code === NavigationSkippedCode.IgnoredSameUrlNavigation |
| 98 | ) { |
| 99 | this.lastSource = undefined; |
| 100 | this.restoredId = 0; |
| 101 | this.scheduleScrollEvent(e, this.urlSerializer.parse(e.url).fragment); |
| 102 | } |
| 103 | }); |
| 104 | } |
| 105 | |
| 106 | private consumeScrollEvents() { |
| 107 | return this.transitions.events.subscribe((e) => { |
no test coverage detected