fix(dashboard): fix unhandled exception for temperature dragger

This commit is contained in:
KostyaDanovsky 2017-07-13 12:04:21 +03:00
parent 7616cb8a4a
commit 009f5c99c9
2 changed files with 8 additions and 6 deletions

View file

@ -1,5 +1,6 @@
import {
Component, HostListener, ViewChild, ElementRef, Input, Output, EventEmitter, AfterViewInit, OnChanges,
ChangeDetectorRef,
} from '@angular/core';
const VIEW_BOX_SIZE = 300;
@ -74,13 +75,14 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges {
private isMouseDown = false;
private init = false;
constructor() {
constructor(private changeDetectorRef: ChangeDetectorRef) {
this.oldValue = this.value;
}
ngAfterViewInit(): void {
this.invalidate();
this.init = true;
this.changeDetectorRef.detectChanges();
}
ngOnChanges(): void {