Browse Source

Fix algebraic sign by resetting member variables

pull/1811/head
Thomas 3 years ago
parent
commit
1010497263
  1. 10
      libs/ui/src/lib/value/value.component.ts

10
libs/ui/src/lib/value/value.component.ts

@ -37,6 +37,8 @@ export class ValueComponent implements OnChanges {
public constructor() {} public constructor() {}
public ngOnChanges() { public ngOnChanges() {
this.initializeVariables();
if (this.value || this.value === 0) { if (this.value || this.value === 0) {
if (isNumber(this.value)) { if (isNumber(this.value)) {
this.isNumber = true; this.isNumber = true;
@ -120,4 +122,12 @@ export class ValueComponent implements OnChanges {
this.useAbsoluteValue = true; this.useAbsoluteValue = true;
} }
} }
private initializeVariables() {
this.absoluteValue = 0;
this.formattedValue = '';
this.isNumber = false;
this.isString = false;
this.useAbsoluteValue = false;
}
} }

Loading…
Cancel
Save