OnCheck
The ngDoCheck method serves the purpose of enhancing the component's dirty checking mechanism, allowing you to detect when change detection is triggered for the component.
However, it is crucial to note that this approach has certain limitations when it comes to components defined with the OnPush strategy. In such cases, the ngDoCheck method is also invoked in the top-level component to ensure that no custom checks are defined by the user.
Nonetheless, for the child components, this can serve as an indication of whether change detection was activated for them.
(see Angular ngDoCheck() gets called even with ChangeDetectionStrategy.OnPush)
Binding
add a binding to a function, similar to the following:
<span>{{ checkChangeDetection() }}</span>
then in ts file
checkChangeDetection() {
console.log("checked!)
}