ApplicationManager and better memory management

This commit is contained in:
Mo Bitar
2020-03-23 19:59:55 -05:00
parent 7dc3dab90b
commit ee7cb1fce6
55 changed files with 36786 additions and 3046 deletions

View File

@@ -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: '='
};
}
}