Bugfix/fix algebraic sign in value component (#1811)

* Fix algebraic sign by resetting member variables

* Update changelog
This commit is contained in:
Thomas Kaul
2023-03-26 16:16:24 +02:00
committed by GitHub
parent f92ba54060
commit b37df2c84f
2 changed files with 16 additions and 0 deletions

View File

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