ApplicationManager and better memory management
This commit is contained in:
@@ -5,13 +5,10 @@ import { PureCtrl } from '@Controllers';
|
||||
class ChallengeModalCtrl extends PureCtrl {
|
||||
/* @ngInject */
|
||||
constructor(
|
||||
$scope,
|
||||
$element,
|
||||
$timeout,
|
||||
application,
|
||||
appState
|
||||
$timeout
|
||||
) {
|
||||
super($scope, $timeout, application, appState);
|
||||
super($timeout);
|
||||
this.$element = $element;
|
||||
this.processingTypes = [];
|
||||
}
|
||||
@@ -48,6 +45,13 @@ class ChallengeModalCtrl extends PureCtrl {
|
||||
});
|
||||
}
|
||||
|
||||
deinit() {
|
||||
this.application = null;
|
||||
this.orchestrator = null;
|
||||
this.challenge = null;
|
||||
super.deinit();
|
||||
}
|
||||
|
||||
reloadProcessingStatus() {
|
||||
this.setState({
|
||||
processing: this.processingTypes.length > 0
|
||||
@@ -106,7 +110,10 @@ class ChallengeModalCtrl extends PureCtrl {
|
||||
}
|
||||
|
||||
dismiss() {
|
||||
this.$element.remove();
|
||||
const elem = this.$element;
|
||||
const scope = elem.scope();
|
||||
scope.$destroy();
|
||||
elem.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,11 +123,10 @@ export class ChallengeModal {
|
||||
this.template = template;
|
||||
this.controller = ChallengeModalCtrl;
|
||||
this.controllerAs = 'ctrl';
|
||||
this.bindToController = true;
|
||||
this.scope = {
|
||||
onSubmit: '=',
|
||||
this.bindToController = {
|
||||
challenge: '=',
|
||||
orchestrator: '='
|
||||
orchestrator: '=',
|
||||
application: '='
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user