From c5ed2d219acb6b3ba37535c76d655851e84ed8e7 Mon Sep 17 00:00:00 2001 From: Rob Wormald Date: Wed, 2 Dec 2015 00:58:23 -0800 Subject: [PATCH] chore(changelog): add lifecycle breaking changes --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dfad611a7..ae9ed2a30d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,46 @@ cause Http's Observable to error. * A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need. +* Previously, components that would implement lifecycle interfaces would include methods +like "onChanges" or "afterViewInit." Given that components were at risk of using such +names without realizing that Angular would call the methods at different points of +the component lifecycle. This change adds an "ng" prefix to all lifecycle hook methods, +far reducing the risk of an accidental name collision. + + To fix, just rename these methods: + * onInit + * onDestroy + * doCheck + * onChanges + * afterContentInit + * afterContentChecked + * afterViewInit + * afterViewChecked + * _Router Hooks_ + * onActivate + * onReuse + * onDeactivate + * canReuse + * canDeactivate + + To: + * ngOnInit, + * ngOnDestroy, + * ngDoCheck, + * ngOnChanges, + * ngAfterContentInit, + * ngAfterContentChecked, + * ngAfterViewInit, + * ngAfterViewChecked + * _Router Hooks_ + * routerOnActivate + * routerOnReuse + * routerOnDeactivate + * routerCanReuse + * routerCanDeactivate + + The names of lifecycle interfaces and enums have not changed, though interfaces + have been updated to reflect the new method names. # 2.0.0-alpha.46 (2015-11-11)