docs: add note to clarify that ngOnChanges is only called if inputs are bound (#42374)

fixes #23017

PR Close #42374
This commit is contained in:
Andrew Scott 2021-05-26 16:03:23 -07:00 committed by Andrew Kushnir
parent 141791e070
commit 7a6358b4a8
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ Angular executes hook methods in the following sequence. You can use them to per
</td>
<td>
Called before `ngOnInit()` and whenever one or more data-bound input properties change.
Called before `ngOnInit()` (if the component has bound inputs) and whenever one or more data-bound input properties change.
Note that if your component has no inputs or you use it without providing any inputs, the framework will not call `ngOnChanges()`.
@ -79,7 +79,7 @@ Angular executes hook methods in the following sequence. You can use them to per
</td>
<td>
Called once, after the first `ngOnChanges()`.
Called once, after the first `ngOnChanges()`. `ngOnInit()` is still called even when `ngOnChanges()` is not (which is the case when there are no template-bound inputs).
</td>
</tr>