@ -8,14 +8,15 @@
|
||||
|
||||
import {LocationStrategy} from '@angular/common';
|
||||
import {Attribute, Directive, ElementRef, HostBinding, HostListener, Input, OnChanges, OnDestroy, Renderer2, isDevMode} from '@angular/core';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
import {Subscription} from 'rxjs';
|
||||
|
||||
import {QueryParamsHandling} from '../config';
|
||||
import {NavigationEnd} from '../events';
|
||||
import {NavigationEnd, RouterEvent} from '../events';
|
||||
import {Router} from '../router';
|
||||
import {ActivatedRoute} from '../router_state';
|
||||
import {UrlTree} from '../url_tree';
|
||||
|
||||
|
||||
/**
|
||||
* @whatItDoes Lets you link to specific parts of your app.
|
||||
*
|
||||
@ -184,7 +185,7 @@ export class RouterLinkWithHref implements OnChanges, OnDestroy {
|
||||
constructor(
|
||||
private router: Router, private route: ActivatedRoute,
|
||||
private locationStrategy: LocationStrategy) {
|
||||
this.subscription = router.events.subscribe(s => {
|
||||
this.subscription = router.events.subscribe((s: RouterEvent) => {
|
||||
if (s instanceof NavigationEnd) {
|
||||
this.updateTargetUrlAndHref();
|
||||
}
|
||||
|
@ -7,11 +7,14 @@
|
||||
*/
|
||||
|
||||
import {AfterContentInit, ChangeDetectorRef, ContentChildren, Directive, ElementRef, Input, OnChanges, OnDestroy, QueryList, Renderer2, SimpleChanges} from '@angular/core';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
import {NavigationEnd} from '../events';
|
||||
import {Subscription} from 'rxjs';
|
||||
|
||||
import {NavigationEnd, RouterEvent} from '../events';
|
||||
import {Router} from '../router';
|
||||
|
||||
import {RouterLink, RouterLinkWithHref} from './router_link';
|
||||
|
||||
|
||||
/**
|
||||
* @whatItDoes Lets you add a CSS class to an element when the link's route becomes active.
|
||||
*
|
||||
@ -93,7 +96,7 @@ export class RouterLinkActive implements OnChanges,
|
||||
constructor(
|
||||
private router: Router, private element: ElementRef, private renderer: Renderer2,
|
||||
private cdr: ChangeDetectorRef) {
|
||||
this.subscription = router.events.subscribe(s => {
|
||||
this.subscription = router.events.subscribe((s: RouterEvent) => {
|
||||
if (s instanceof NavigationEnd) {
|
||||
this.update();
|
||||
}
|
||||
|
Reference in New Issue
Block a user