Every editor page will instantiate its own editor service
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-11-02 21:59:58 -06:00
parent 0e0d237d4f
commit 26e8d6ecd6
8 changed files with 45 additions and 13 deletions

View File

@@ -48,19 +48,19 @@
</button>
</div>
<ng-container *ngIf="node.isNorm()">
<editor-norm style="flex: 1;" [nodeId]="node.UUID"></editor-norm>
<editor-norm style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-norm>
</ng-container>
<ng-container *ngIf="node.type === 'markdown'">
<editor-markdown style="flex: 1;" [nodeId]="node.UUID"></editor-markdown>
<editor-markdown style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-markdown>
</ng-container>
<ng-container *ngIf="node.type === 'database_ref'">
<editor-database style="flex: 1;" [nodeId]="node.UUID"></editor-database>
<editor-database style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-database>
</ng-container>
<ng-container *ngIf="node.type === 'code_ref'">
<editor-code style="flex: 1;" [nodeId]="node.UUID"></editor-code>
<editor-code style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-code>
</ng-container>
<ng-container *ngIf="node.type === 'file_ref'">
<editor-files style="flex: 1;" [nodeId]="node.UUID"></editor-files>
<editor-files style="flex: 1;" [nodeId]="node.UUID" [editorUUID]="editorService.instanceUUID"></editor-files>
</ng-container>
</div>
<button class="host-add-button" (click)="onAddClick($event)">

View File

@@ -7,7 +7,7 @@ import {HostOptionsComponent} from '../../components/editor/host-options/host-op
import {EditorService} from '../../service/editor.service';
import {NodeTypeIcons} from '../../structures/node-types';
import {OptionMenuComponent} from '../../components/option-menu/option-menu.component';
import {VersionModalComponent} from "../../components/version-modal/version-modal.component";
import {VersionModalComponent} from '../../components/version-modal/version-modal.component';
@Component({
selector: 'app-editor',
@@ -30,6 +30,8 @@ export class EditorPage implements OnInit {
this.route.params.subscribe(params => {
this.pageId = params.id;
});
this.editorService = editorService.getEditor();
}
ngOnInit() {}