From f6dee72a88cc4e3448d865b30308e4c7a3fbcd06 Mon Sep 17 00:00:00 2001 From: ajitsinghkaler Date: Fri, 10 Jan 2020 09:21:32 +0530 Subject: [PATCH] docs: add note that when ngOnInit not used (#34619) In some examples ngOnInit was missing added note to tell when it is missing. Fixes #34562 PR Close #34619 --- aio/content/start/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aio/content/start/index.md b/aio/content/start/index.md index 2d8bb3e813..f78e4dcbce 100644 --- a/aio/content/start/index.md +++ b/aio/content/start/index.md @@ -311,6 +311,13 @@ To make the "Notify Me" button work, you need to configure two things: 1. In the component class, define a property named `notify` with an `@Output()` decorator and an instance of `EventEmitter()`. This allows the product alert component to emit an event when the value of the notify property changes. +
+ + When the Angular CLI generates a new component, it includes an empty constructor, the `OnInit` interface, and the `ngOnInit()` method. + Since the following example isn't using them, they are omitted here for brevity. + +
+ 1. In the product alert template, `product-alerts.component.html`, update the "Notify Me" button with an event binding to call the `notify.emit()` method.