p.location-badge.
exported from angular2/lifecycle_hooks
defined in angular2/src/core/compiler/interfaces.ts (line 52)
:markdown
Notify a directive when it has been checked the first time.
`onInit` is called right after the directive's bindings have been checked for the first time,
and before any of its children's bindings have been checked.
It is invoked only once.
## Example
```
@Component(...)
class MyComponent implements OnInit {
onInit(): void {
}
}
```
.l-main-section
h2 Members
.l-sub-section
h3#onInit onInit
pre.prettyprint
code.
onInit()
:markdown