()
| 40 | private _headerTagManager = inject(HeaderTagManager); |
| 41 | |
| 42 | constructor() { |
| 43 | const analytics = inject(AnalyticsService); |
| 44 | const navigationFocusService = inject(NavigationFocusService); |
| 45 | const router = inject(Router); |
| 46 | |
| 47 | this._subscriptions.add( |
| 48 | navigationFocusService.navigationEndEvents |
| 49 | .pipe( |
| 50 | map(e => e.urlAfterRedirects), |
| 51 | startWith(''), |
| 52 | pairwise(), |
| 53 | ) |
| 54 | .subscribe(([fromUrl, toUrl]) => { |
| 55 | // We want to reset the scroll position on navigation except when navigating within |
| 56 | // the documentation for a single component. |
| 57 | if (!navigationFocusService.isNavigationWithinComponentView(fromUrl, toUrl)) { |
| 58 | resetScrollPosition(); |
| 59 | } |
| 60 | analytics.locationChanged(toUrl); |
| 61 | }), |
| 62 | ); |
| 63 | |
| 64 | router.events |
| 65 | .pipe( |
| 66 | filter((e): e is NavigationEnd => e instanceof NavigationEnd), |
| 67 | map(event => event.urlAfterRedirects), |
| 68 | ) |
| 69 | .subscribe(url => { |
| 70 | this._updateCanonicalLink(url); |
| 71 | }); |
| 72 | } |
| 73 | |
| 74 | ngOnDestroy() { |
| 75 | this._subscriptions.unsubscribe(); |
nothing calls this directly
no test coverage detected