refactor(upgrade): share code for destroying upgraded components between dynamic
and static
(#25357)
PR Close #25357
This commit is contained in:

committed by
Misko Hevery

parent
51c26b8afb
commit
71007ef9b2
@ -119,6 +119,13 @@ export class UpgradeHelper {
|
||||
return this.compileHtml(template);
|
||||
}
|
||||
|
||||
onDestroy($scope: angular.IScope, controllerInstance?: any) {
|
||||
if (controllerInstance && isFunction(controllerInstance.$onDestroy)) {
|
||||
controllerInstance.$onDestroy();
|
||||
}
|
||||
$scope.$destroy();
|
||||
}
|
||||
|
||||
prepareTransclusion(): angular.ILinkFn|undefined {
|
||||
const transclude = this.directive.transclude;
|
||||
const contentChildNodes = this.extractChildNodes();
|
||||
|
Reference in New Issue
Block a user