From 1a3f50383ea90e4a1a5c58f20d5f85dfacb0851e Mon Sep 17 00:00:00 2001 From: splincode Date: Tue, 12 Nov 2024 11:57:18 +0300 Subject: [PATCH] refactor: drop editor loaded async pipe --- .../components/editor/editor.component.html | 112 +++++++++--------- .../components/editor/editor.component.ts | 8 +- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/projects/editor/components/editor/editor.component.html b/projects/editor/components/editor/editor.component.html index 66e887414..26e1980c6 100644 --- a/projects/editor/components/editor/editor.component.html +++ b/projects/editor/components/editor/editor.component.html @@ -1,10 +1,10 @@
- - - - - - - - + + + + + + + - + +
-
-
+ tuiTiptapEditor + class="tui-editor-socket" + [editable]="interactive()" + [value]="firstInitialValue" + (valueChange)="onModelChange($event)" + >
+
- -
- - - + +
+ + + - + - - - -
-
+ + + +
- + implements OnDestroy { protected readonly toolbar?: TuiToolbar; protected readonly options = inject(TUI_EDITOR_OPTIONS); + protected readonly editorLoaded = signal(false); protected readonly editorLoaded$ = inject(TIPTAP_EDITOR); - protected sub = this.editorLoaded$ + protected readonly $ = this.editorLoaded$ .pipe(delay(0), takeUntilDestroyed()) .subscribe(() => { this.hasMentionPlugin = !!this.editorService @@ -136,6 +137,7 @@ export class TuiEditor extends TuiControl implements OnDestroy { this.patchContentEditableElement(); this.listenResizeEvents(); + this.editorLoaded.set(true); }); /**