diff --git a/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts b/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts index 0fdd9f436d..6ed0714b9b 100644 --- a/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts @@ -14,28 +14,38 @@ let nextHeroDetailId = 1; outputs: ['deleted'], // #enddocregion input-output-2 template: ` -
`, + styles:['a { cursor: pointer; cursor: hand; }'] // #docregion input-output-2 }) // #enddocregion input-output-2 export class HeroDetailComponent { - hero: Hero; + constructor() { + // Toggle the line-through style so we see something happen + // even if no one attaches to the `deleted` event. + // Subscribing in ctor rather than the more obvious thing of doing it in + // OnDelete because don't want this mess to distract the chapter reader. + this.deleted.subscribe(() => { + this.lineThrough = this.lineThrough ? '' : 'line-through'; + }) + } + // #docregion deleted deleted = new EventEmitter