Moved some 'editors.component' items to the service
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ComponentRef, Injectable } from '@angular/core';
|
||||
import { BehaviorSubject, ReplaySubject, Observable } from 'rxjs';
|
||||
|
||||
import { NewtonEditorComponent } from "../../../editor/newton-editor/newton-editor.component";
|
||||
|
||||
import { ServiceMessage } from '../../types/service-message.type';
|
||||
import { EditorSettings } from "../../configs/editor.config";
|
||||
|
||||
|
||||
|
||||
@@ -18,8 +21,27 @@ export class EditorsService {
|
||||
private moveSessionLeftSubject: ReplaySubject<any> = new ReplaySubject<any>(1);
|
||||
private moveSessionRightSubject: ReplaySubject<any> = new ReplaySubject<any>(1);
|
||||
|
||||
editors: Map<string, ComponentRef<NewtonEditorComponent>>;
|
||||
editorSettings: typeof EditorSettings;
|
||||
|
||||
constructor() {}
|
||||
|
||||
constructor() {
|
||||
this.editorSettings = EditorSettings;
|
||||
this.editors = new Map<string, ComponentRef<NewtonEditorComponent>>();
|
||||
}
|
||||
|
||||
|
||||
getEditorsAsArray(): ComponentRef<NewtonEditorComponent>[] {
|
||||
return [...this.editors.values()];
|
||||
}
|
||||
|
||||
get(uuid: string): NewtonEditorComponent {
|
||||
return this.editors.get(uuid).instance;
|
||||
}
|
||||
|
||||
set(uuid: string, component: ComponentRef<NewtonEditorComponent>) {
|
||||
this.editors.set(uuid, component);
|
||||
}
|
||||
|
||||
|
||||
setData(data: ServiceMessage): void {
|
||||
|
Reference in New Issue
Block a user