p.location-badge. exported from angular2/lifecycle_hooks defined in angular2/src/core/compiler/interfaces.ts (line 12) :markdown Lifecycle hooks are guaranteed to be called in the following order: - `OnChanges` (if any bindings have changed), - `OnInit` (after the first check only), - `DoCheck`, - `AfterContentInit`, - `AfterContentChecked`, - `OnDestroy` (at the very end before destruction) Notify a directive when any of its bindings have changed. `onChanges` is called right after the directive's bindings have been checked, and before any of its children's bindings have been checked. It is invoked only if at least one of the directive's bindings has changed. ## Example: ``` @Component(...) class MyComponent implements OnChanges { propA; propB; onChanges(changes: {[idx: string, PropertyUpdate]}): void { // This will get called after any of the properties have been updated. if (changes['propA']) { // if propA was updated } if (changes['propA']) { // if propB was updated } } } ``` .l-main-section h2 Members .l-sub-section h3#onChanges onChanges pre.prettyprint code. onChanges(changes: StringMap<string, any>) :markdown