cleanup(router): fix e2e tests

This commit is contained in:
vsavkin
2016-05-03 10:25:14 -07:00
parent b625f2471a
commit 9f784dcc5a
5 changed files with 10 additions and 14 deletions

View File

@ -22,7 +22,7 @@ import {ObservableWrapper} from '../facade/async';
@Directive({selector: '[routerLink]'})
export class RouterLink implements OnDestroy {
@Input() target: string;
private _comands: any[] = [];
private _commands: any[] = [];
private _subscription: any;
@HostBinding() href: string;
@ -38,9 +38,9 @@ export class RouterLink implements OnDestroy {
@Input()
set routerLink(data: any[]|any) {
if (isArray(data)) {
this._comands = <any[]>data;
this._commands = <any[]>data;
} else {
this._comands = [data];
this._commands = [data];
}
this._updateTargetUrlAndHref();
}
@ -49,14 +49,14 @@ export class RouterLink implements OnDestroy {
@HostListener("click")
onClick(): boolean {
if (!isString(this.target) || this.target == '_self') {
this._router.navigate(this._comands, this._routeSegment);
this._router.navigate(this._commands, this._routeSegment);
return false;
}
return true;
}
private _updateTargetUrlAndHref(): void {
let tree = this._router.createUrlTree(this._comands, this._routeSegment);
let tree = this._router.createUrlTree(this._commands, this._routeSegment);
if (isPresent(tree)) {
this.href = this._router.serializeUrl(tree);
this.isActive = this._router.urlTree.contains(tree);