diff --git a/modules/@angular/router/src/directives/router_link.ts b/modules/@angular/router/src/directives/router_link.ts index 0df77682ef..d7eaf8291b 100644 --- a/modules/@angular/router/src/directives/router_link.ts +++ b/modules/@angular/router/src/directives/router_link.ts @@ -89,11 +89,13 @@ import {UrlTree} from '../url_tree'; */ @Directive({selector: ':not(a)[routerLink]'}) export class RouterLink { - private commands: any[] = []; @Input() queryParams: {[k: string]: any}; @Input() fragment: string; @Input() preserveQueryParams: boolean; @Input() preserveFragment: boolean; + @Input() skipLocationChange: boolean; + @Input() replaceUrl: boolean; + private commands: any[] = []; constructor( private router: Router, private route: ActivatedRoute, @@ -120,7 +122,9 @@ export class RouterLink { queryParams: this.queryParams, fragment: this.fragment, preserveQueryParams: toBool(this.preserveQueryParams), - preserveFragment: toBool(this.preserveFragment) + preserveFragment: toBool(this.preserveFragment), + skipLocationChange: toBool(this.skipLocationChange), + replaceUrl: toBool(this.replaceUrl), }); } } @@ -138,12 +142,14 @@ export class RouterLink { @Directive({selector: 'a[routerLink]'}) export class RouterLinkWithHref implements OnChanges, OnDestroy { @Input() target: string; - private commands: any[] = []; @Input() queryParams: {[k: string]: any}; @Input() fragment: string; @Input() routerLinkOptions: {preserveQueryParams: boolean, preserveFragment: boolean}; @Input() preserveQueryParams: boolean; @Input() preserveFragment: boolean; + @Input() skipLocationChange: boolean; + @Input() replaceUrl: boolean; + private commands: any[] = []; private subscription: Subscription; // the url displayed on the anchor element. @@ -195,7 +201,9 @@ export class RouterLinkWithHref implements OnChanges, OnDestroy { queryParams: this.queryParams, fragment: this.fragment, preserveQueryParams: toBool(this.preserveQueryParams), - preserveFragment: toBool(this.preserveFragment) + preserveFragment: toBool(this.preserveFragment), + skipLocationChange: toBool(this.skipLocationChange), + replaceUrl: toBool(this.replaceUrl), }); } } @@ -203,4 +211,4 @@ export class RouterLinkWithHref implements OnChanges, OnDestroy { function toBool(s?: any): boolean { if (s === '') return true; return !!s; -} \ No newline at end of file +} diff --git a/tools/public_api_guard/router/index.d.ts b/tools/public_api_guard/router/index.d.ts index 94298b6149..e574983efe 100644 --- a/tools/public_api_guard/router/index.d.ts +++ b/tools/public_api_guard/router/index.d.ts @@ -232,7 +232,9 @@ export declare class RouterLink { queryParams: { [k: string]: any; }; + replaceUrl: boolean; routerLink: any[] | string; + skipLocationChange: boolean; urlTree: UrlTree; constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy); onClick(): boolean; @@ -262,11 +264,13 @@ export declare class RouterLinkWithHref implements OnChanges, OnDestroy { queryParams: { [k: string]: any; }; + replaceUrl: boolean; routerLink: any[] | string; routerLinkOptions: { preserveQueryParams: boolean; preserveFragment: boolean; }; + skipLocationChange: boolean; target: string; urlTree: UrlTree; constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);