From 78b6c07a7450603c4570c8754d4de67de6550f85 Mon Sep 17 00:00:00 2001 From: jojohoch <joachim.hoch@iqb.hu-berlin.de> Date: Tue, 27 Jun 2023 09:26:21 +0200 Subject: [PATCH] Convert StateVariable to interface --- projects/common/models/state-variable.ts | 6 +----- .../state-variable-editor.component.ts | 2 +- .../state-variables-dialog.component.ts | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/projects/common/models/state-variable.ts b/projects/common/models/state-variable.ts index d9d37afd0..7028d02d7 100644 --- a/projects/common/models/state-variable.ts +++ b/projects/common/models/state-variable.ts @@ -1,8 +1,4 @@ -export class StateVariable { +export interface StateVariable { id: string; value: string; - constructor(id: string, value: string) { - this.id = id; - this.value = value; - } } diff --git a/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variable-editor.component.ts b/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variable-editor.component.ts index ee07eb08f..08626c82b 100644 --- a/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variable-editor.component.ts +++ b/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variable-editor.component.ts @@ -8,6 +8,6 @@ import { StateVariable } from 'common/models/state-variable'; templateUrl: './state-variable-editor.component.html' }) export class StateVariableEditorComponent { - @Input() stateVariable: StateVariable = new StateVariable('', ''); + @Input() stateVariable: StateVariable = { id: '', value: '' }; @Output() stateVariableChange = new EventEmitter<StateVariable>(); } diff --git a/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variables-dialog.component.ts b/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variables-dialog.component.ts index c76afdd04..50e286c4f 100644 --- a/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variables-dialog.component.ts +++ b/projects/editor/src/app/components/dialogs/state-variables-dialog/state-variables-dialog.component.ts @@ -13,7 +13,7 @@ export class StateVariablesDialogComponent { } addStateVariable() { - this.stateVariables.push(new StateVariable('NewState', '1')); + this.stateVariables.push({ id: 'NewState', value: '1' }); } deleteStateVariable(index: number) { -- GitLab