From 4c79b8a64458dc37947ddc16cc80f2b984b613e0 Mon Sep 17 00:00:00 2001 From: pniedermeyer Date: Wed, 10 Mar 2021 10:43:00 +0100 Subject: [PATCH] docs: Remove of unnecessary Input (#41150) remove unnecessary Input PR Close #41150 --- .../attribute-directives/src/app/highlight.directive.2.ts | 3 --- .../attribute-directives/src/app/highlight.directive.3.ts | 6 ++++-- aio/content/guide/attribute-directives.md | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts b/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts index b18eadbd95..fac7b79e4b 100644 --- a/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts +++ b/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts @@ -26,9 +26,6 @@ export class HighlightDirective { this.el.nativeElement.style.backgroundColor = color; } // #enddocregion mouse-methods - // #docregion color-2 - @Input() appHighlight: string; - // #enddocregion color-2 } // #enddocregion diff --git a/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts b/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts index 4f17bd4924..0d61602c08 100644 --- a/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts +++ b/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts @@ -10,10 +10,12 @@ export class HighlightDirective { constructor(private el: ElementRef) { } - @Input('appHighlight') highlightColor: string; + // #docregion input + @Input() appHighlight: string; + // #enddocregion input @HostListener('mouseenter') onMouseEnter() { - this.highlight(this.highlightColor || 'red'); + this.highlight(this.appHighlight || 'red'); } @HostListener('mouseleave') onMouseLeave() { diff --git a/aio/content/guide/attribute-directives.md b/aio/content/guide/attribute-directives.md index ef2264a3f0..f58db98aed 100644 --- a/aio/content/guide/attribute-directives.md +++ b/aio/content/guide/attribute-directives.md @@ -91,7 +91,7 @@ This section walks you through setting the highlight color while applying the `H 1. Add an `appHighlight` `@Input()` property. - + The `@Input()` decorator adds metadata to the class that makes the directive's `appHighlight` property available for binding.