OnChanges

Stable

Interface

What it does

Lifecycle hook that is called when any data-bound property of a directive changes.

How to use

.

@Component({selector: 'my-cmp', template: `...`}) class MyComponent implements OnChanges { @Input() prop: number; ngOnChanges(changes: SimpleChanges) { // changes.prop contains the old and the new value... } }

Interface Overview

interface OnChanges {
ngOnChanges(changes: SimpleChanges) : void

}

Interface Description

Interface Details

exported from core/index, defined in core/src/metadata/lifecycle_hooks.ts