test(router): add a test checking that guards work for child routes
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import {Directive, HostBinding, HostListener, Input, OnChanges} from '@angular/core';
|
||||
import {LocationStrategy} from '@angular/common';
|
||||
import {Directive, HostBinding, HostListener, Input, OnChanges} from '@angular/core';
|
||||
|
||||
import {Router} from '../router';
|
||||
import {ActivatedRoute} from '../router_state';
|
||||
@ -47,7 +47,9 @@ export class RouterLink implements OnChanges {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(private router: Router, private route: ActivatedRoute, private locationStrategy: LocationStrategy) {}
|
||||
constructor(
|
||||
private router: Router, private route: ActivatedRoute,
|
||||
private locationStrategy: LocationStrategy) {}
|
||||
|
||||
@Input()
|
||||
set routerLink(data: any[]|string) {
|
||||
@ -60,7 +62,7 @@ export class RouterLink implements OnChanges {
|
||||
|
||||
ngOnChanges(changes: {}): any { this.updateTargetUrlAndHref(); }
|
||||
|
||||
@HostListener("click", ["$event.button", "$event.ctrlKey", "$event.metaKey"])
|
||||
@HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey'])
|
||||
onClick(button: number, ctrlKey: boolean, metaKey: boolean): boolean {
|
||||
if (button !== 0 || ctrlKey || metaKey) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user