TimeRegions: Fixed issue with time regions and tresholds due to angular js upgrade (#29229)

This commit is contained in:
Torkel Ödegaard 2020-11-19 14:37:04 +01:00 committed by GitHub
parent 32d4c8c6bc
commit 993adb72e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -7,14 +7,16 @@ export class ThresholdFormCtrl {
disabled: boolean;
/** @ngInject */
constructor($scope: any) {
constructor(private $scope: any) {}
$onInit() {
this.panel = this.panelCtrl.panel;
if (this.panel.alert) {
this.disabled = true;
}
const unbindDestroy = $scope.$on('$destroy', () => {
const unbindDestroy = this.$scope.$on('$destroy', () => {
this.panelCtrl.editingThresholds = false;
this.panelCtrl.render();
unbindDestroy();

View File

@ -8,10 +8,12 @@ export class TimeRegionFormCtrl {
colorModes: any;
/** @ngInject */
constructor($scope: any) {
constructor(private $scope: any) {}
$onInit() {
this.panel = this.panelCtrl.panel;
const unbindDestroy = $scope.$on('$destroy', () => {
const unbindDestroy = this.$scope.$on('$destroy', () => {
this.panelCtrl.editingTimeRegions = false;
this.panelCtrl.render();
unbindDestroy();