Moved uuid asignment to ace base
This commit is contained in:
parent
6e5af8e85d
commit
89b68d0422
@ -1,4 +1,5 @@
|
||||
import { Directive, ElementRef, Input, ViewChild } from '@angular/core';
|
||||
import * as uuid from 'uuid';
|
||||
|
||||
import { EditorSettings } from "../../common/configs/editor.config";
|
||||
import { NewtonFile } from '../../common/types/file.type';
|
||||
@ -17,7 +18,9 @@ export class AceEditorBase {
|
||||
|
||||
|
||||
constructor(
|
||||
) {}
|
||||
) {
|
||||
this.uuid = uuid.v4();
|
||||
}
|
||||
|
||||
|
||||
protected search() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { Component, ElementRef, ViewChild, TemplateRef, ComponentRef, ViewContainerRef } from '@angular/core';
|
||||
import { Subject, takeUntil } from 'rxjs';
|
||||
import * as uuid from 'uuid';
|
||||
|
||||
import { EditSession } from 'ace-builds';
|
||||
import { getModeForPath } from 'ace-builds/src-noconflict/ext-modelist';
|
||||
@ -154,7 +153,6 @@ export class EditorsComponent {
|
||||
private createEditor() {
|
||||
const component = this.containerRef.createComponent(AceEditorComponent);
|
||||
component.instance.editorSettings = this.editorSettings;
|
||||
component.instance.uuid = uuid.v4();
|
||||
this.editors.set(component.instance.uuid, component)
|
||||
|
||||
return component;
|
||||
|
Loading…
Reference in New Issue
Block a user