ngDoCheck hook has a bit misleading documentation

This issue has been created since 2022-11-20.

Describe the problem that you experienced

Hello,

in my opinion the documentation regarding the DoCheck hook is a bit misleading:
A lifecycle hook that invokes a custom change-detection function for a directive, in addition to the check performed by the default change-detector.

Text in bold implies that the default check was performed (for the component from which the hook is called), when in fact it doesn't need to be the case. If we have a component with the OnPush change detection strategy, its ngDoCheck hook is called from its parent, despite the fact that the default check was not performed on the component.

The following article sums up why ngDoCheck called =/= change detection performed (it's from 2017, I think that many people fell in the trap of believing that ngDoCheck called = change detection performed):
https://medium.com/angular-in-depth/if-you-think-ngdocheck-means-your-component-is-being-checked-read-this-article-36ce63a3f3e5

Enter the URL of the topic with the problem

No response

Describe what you were looking for in the documentation

No response

Describe the actions that led you to experience the problem

No response

Describe what you want to experience that would fix the problem

No response

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here

No response

If the problem is browser-specific, please specify the device, OS, browser, and version

No response

Provide any additional information here in as much as detail as you can

No response

mlc-mlapis wrote this answer on 2022-11-20

@lukasmatta Also related to the formulations here:
image

If we have a component with the OnPush change detection strategy, its ngDoCheck hook is called from its parent, despite the fact that the default check was not performed on the component.

It's the most crucial part you've mentioned.

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-12-01
Star Count 85220
Watcher Count 3042
Fork Count 22607
Issue Count 1316

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
project context menu: add batch build project 2 2022-06-22 2022-09-09
360p and 720p quality is shown twice. 1 2022-06-25 2022-11-09
卒業生はダッシュボードのニコニコカレンダーを非表示にできるようにしたい 4 2022-03-04 2022-11-06
【メンター向け】「n日経過」の部分に件数を入れたい 0 2022-03-03 2022-03-02
「学習時間」と「GitHub」の位置が、どのような画面幅でもズレないようにしたい 2 2022-03-03 2022-09-12
gstoraster shifts image down 2 2021-05-31 2022-10-14
Bug: Correct XMR but fiat as 0 in Monero.com wallet 1 2022-04-22 2022-08-01
The built-in exchange supports TRC20-USDT 4 2022-04-27 2022-07-28
[Definition Section] Definition Section is always opend 0 2017-12-13 2022-10-28
Checkerboard decompositions 0 2022-02-11 2022-11-11
Question: can I get the git hash that a prjoxide executable was built at? 1 2021-10-02 2022-11-03
Add StakePoolOperator Scripts by Martin 2 2022-09-17 2022-11-19
How can I use parameter --author if value has spaces? 4 2021-12-21 2022-11-08
Не хватает материала об отличиях контентного изображения от декоративного 1 2022-10-28 2022-10-27
Не хватает материала о `document.designMode` 0 2022-10-24 2022-10-27
gitlab 代理有问题 2 2020-07-10 2022-01-21
Nollup / Rollup not compiling external components 1 2021-04-05 2022-10-04
推流有的时候可以推上去,有的时候会返回254 5 2021-08-09 2022-10-25
IoBroker Bluetooth connection for Daly-BMS 10 2022-03-25 2022-11-10
RelationList Widget 9 2022-05-11 2022-11-29
The way to get Chinese Word Embedding. 4 2021-12-17 2022-11-25
Migrate Website to Docusaurus 2 Alpha 1 2019-11-28 2022-11-14
Feature request regarding adding/removing tasks from jobs 2 2022-07-13 2022-10-24
[BUG]使用icalingua-bridge的时候偶发崩溃 0 2021-12-26 2022-01-22
Gitpod打开模板项目使用默认的那个bash窗口执行yarn start 后, root url是正常的,如果在新增的bash上就不正常了 1 2022-01-02 2022-10-09
Add resource options to the Helm chart for bootloader and temporal pods 0 2022-05-12 2022-09-17
Custom fonts broken when publishing PDF 24 2019-07-18 2022-09-08
Help with markdown display and...iterm2? 4 2020-11-22 2022-10-25
Apostroph Problem in Header Navigation 0 2022-08-11 2022-08-11
[Umbrella] Changesets v3 16 2021-11-08 2022-11-10
CSV header parsing with empty column name and sep="\t" or sep=" " skips column. 1 2021-12-03 2022-11-04
Reanimated does not work in mixed development of ios and react native 6 2022-01-05 2022-10-06
Route travel inside part, like in S3D 3 2022-08-30 2022-10-15
Unspecified Referrers API Behavior on Non-Existing Manifest 5 2022-10-28 2022-11-14
NPM Package not found 6 2021-08-14 2022-10-18
[Dev Site] bump SDK version `January` 1 2021-12-04 2022-10-22
`bst build` appears to build same module twice 1 2021-05-03 2022-10-03
Remove Fact.toEvent after refactoring FactProcessor 3 2022-03-30 2022-10-21
Help on implementation of LTMU trackers on your framework 7 2021-03-31 2022-10-24
Implement loading DDS textures at run-time 1 2022-11-09 2022-11-28
[BUG] - FriendNotifications plugin not working (blurred notifications) 1 2021-08-12 2022-11-27
recent orders block in my account show only orders from current store 9 2021-11-22 2022-01-04
Headless chrome / Firefox with link click download 0 2022-07-26 2022-10-19
project.version must be accessed lazy 0 2021-09-01 2022-11-22
Multi-tab app, with notifications. 1 2020-01-07 2022-11-30
Bug 1 2021-08-31 2021-09-12
Bump version to 1.10.2 0 2021-04-12 2022-11-10
Updated body-parser to version 1.14.0 0 2015-09-27 2022-10-27
Trying to run TestRuntime.py sample gives 'expected CFunctionType instance instead of int' error 3 2022-08-24 2022-10-14
Explore ways to indicate to user whether Python is not installed or is invalid 2 2022-07-14 2022-10-25