Skip to content
Snippets Groups Projects
Commit 6a12f619 authored by rhenck's avatar rhenck
Browse files

[editor] Remove IDService from places other than the unit service

It is better to hide that abstraction in the unit service.
parent 911100f1
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@ import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';
import { VeronaAPIService, VoeStartCommand } from './services/verona-api.service';
import { UnitService } from './services/unit.service';
import { IdService } from './services/id.service';
@Component({
selector: 'editor-aspect',
......@@ -22,7 +21,6 @@ export class AppComponent implements OnInit {
isStandalone = (): boolean => window === window.parent;
constructor(private unitService: UnitService,
private idService: IdService,
private translateService: TranslateService,
private veronaApiService: VeronaAPIService) {
translateService.addLangs(['de']);
......@@ -32,7 +30,6 @@ export class AppComponent implements OnInit {
ngOnInit(): void {
this.veronaApiService.voeStartCommand
.subscribe((message: VoeStartCommand): void => {
this.idService.reset();
this.unitService.loadUnitDefinition(message.unitDefinition);
});
this.veronaApiService.voeGetDefinitionRequest
......
import { Component } from '@angular/core';
import { UnitService } from '../../services/unit.service';
import { IdService } from '../../services/id.service';
@Component({
selector: 'app-toolbar',
......@@ -11,17 +10,13 @@ import { IdService } from '../../services/id.service';
]
})
export class ToolbarComponent {
constructor(
private unitService: UnitService,
private idService: IdService
) { }
constructor(private unitService: UnitService) { }
save(): void {
this.unitService.saveUnit();
}
async load(): Promise<void> {
this.idService.reset();
await this.unitService.loadUnitFromFile();
}
}
......@@ -49,6 +49,7 @@ export class UnitService {
loadUnitDefinition(unitDefinition: string): void {
if (unitDefinition) {
this.idService.reset();
this.unit = new Unit(JSON.parse(unitDefinition));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment