Commit 993adb72 by Torkel Ödegaard Committed by GitHub

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

parent 32d4c8c6
......@@ -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();
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment