41 lines
839 B
Plaintext
41 lines
839 B
Plaintext
|
|
p.location-badge.
|
|
exported from <a href='../lifecycle_hooks'>angular2/lifecycle_hooks</a>
|
|
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/interfaces.ts#L72-L93">angular2/src/core/compiler/interfaces.ts (line 72)</a>
|
|
|
|
:markdown
|
|
Overrides the default change detection.
|
|
|
|
`doCheck()` gets called to check the changes in the directives instead of the default
|
|
change detection mechanism.
|
|
|
|
It is invoked every time the change detection is triggered.
|
|
|
|
## Example
|
|
|
|
```
|
|
@Component(...)
|
|
class MyComponent implements DoCheck {
|
|
doCheck(): void {
|
|
// Custom logic to detect changes
|
|
}
|
|
}
|
|
```
|
|
|
|
|
|
.l-main-section
|
|
h2 Members
|
|
.l-sub-section
|
|
h3#doCheck doCheck
|
|
|
|
|
|
pre.prettyprint
|
|
code.
|
|
doCheck()
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|