diff --git a/modules/angular2/src/upgrade/angular_js.ts b/modules/angular2/src/upgrade/angular_js.ts index 1c1fdf452f..02d6fd6d31 100644 --- a/modules/angular2/src/upgrade/angular_js.ts +++ b/modules/angular2/src/upgrade/angular_js.ts @@ -22,6 +22,7 @@ export interface IRootScopeService { $new(isolate?: boolean): IScope; $id: string; $watch(expr: any, fn?: (a1?: any, a2?: any) => void): Function; + $destroy(): any; $apply(): any; $apply(exp: string): any; $apply(exp: Function): any; diff --git a/modules/angular2/src/upgrade/downgrade_ng2_adapter.ts b/modules/angular2/src/upgrade/downgrade_ng2_adapter.ts index e0051c4ae0..6be40d39a1 100644 --- a/modules/angular2/src/upgrade/downgrade_ng2_adapter.ts +++ b/modules/angular2/src/upgrade/downgrade_ng2_adapter.ts @@ -160,7 +160,10 @@ export class DowngradeNg2ComponentAdapter { } registerCleanup() { - this.element.bind('$destroy', () => this.viewManager.destroyRootHostView(this.hostViewRef)); + this.element.bind('$destroy', () => { + this.componentScope.$destroy(); + this.viewManager.destroyRootHostView(this.hostViewRef); + }); } }