docs: update testing doc example style for HostListener (#26372)

HostListener is preferred over host metadata by official style guide

PR Close #26372
This commit is contained in:
krzysztof-grzybek
2018-10-10 18:42:07 +02:00
committed by Andrew Kushnir
parent ca3965afe0
commit de80f1b6dd
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { Directive, Input } from '@angular/core';
import { Directive, Input, HostListener } from '@angular/core';
// export for convenience.
export { RouterLink} from '@angular/router';
@ -6,13 +6,13 @@ export { RouterLink} from '@angular/router';
/* tslint:disable:directive-class-suffix */
// #docregion router-link
@Directive({
selector: '[routerLink]',
host: { '(click)': 'onClick()' }
selector: '[routerLink]'
})
export class RouterLinkDirectiveStub {
@Input('routerLink') linkParams: any;
navigatedTo: any = null;
@HostListener('click')
onClick() {
this.navigatedTo = this.linkParams;
}