docs: Remove of unnecessary Input (#41150)

remove unnecessary Input

PR Close #41150
This commit is contained in:
pniedermeyer 2021-03-10 10:43:00 +01:00 committed by Andrew Kushnir
parent ba81e8cc94
commit 4c79b8a644
3 changed files with 5 additions and 6 deletions

View File

@ -26,9 +26,6 @@ export class HighlightDirective {
this.el.nativeElement.style.backgroundColor = color; this.el.nativeElement.style.backgroundColor = color;
} }
// #enddocregion mouse-methods // #enddocregion mouse-methods
// #docregion color-2
@Input() appHighlight: string;
// #enddocregion color-2
} }
// #enddocregion // #enddocregion

View File

@ -10,10 +10,12 @@ export class HighlightDirective {
constructor(private el: ElementRef) { } constructor(private el: ElementRef) { }
@Input('appHighlight') highlightColor: string; // #docregion input
@Input() appHighlight: string;
// #enddocregion input
@HostListener('mouseenter') onMouseEnter() { @HostListener('mouseenter') onMouseEnter() {
this.highlight(this.highlightColor || 'red'); this.highlight(this.appHighlight || 'red');
} }
@HostListener('mouseleave') onMouseLeave() { @HostListener('mouseleave') onMouseLeave() {

View File

@ -91,7 +91,7 @@ This section walks you through setting the highlight color while applying the `H
1. Add an `appHighlight` `@Input()` property. 1. Add an `appHighlight` `@Input()` property.
<code-example path="attribute-directives/src/app/highlight.directive.2.ts" header="src/app/highlight.directive.ts" region="color-2"></code-example> <code-example path="attribute-directives/src/app/highlight.directive.3.ts" header="src/app/highlight.directive.ts" region="input"></code-example>
The `@Input()` decorator adds metadata to the class that makes the directive's `appHighlight` property available for binding. The `@Input()` decorator adds metadata to the class that makes the directive's `appHighlight` property available for binding.