@@ -15,15 +15,15 @@ npm install superdoc
1515## Basic setup
1616
1717``` typescript
18- import { Component , ElementRef , ViewChild , OnDestroy } from ' @angular/core' ;
18+ import { Component , ElementRef , ViewChild , OnInit , OnDestroy } from ' @angular/core' ;
1919import { SuperDoc } from ' superdoc' ;
2020import ' superdoc/style.css' ;
2121
2222@Component ({
2323 selector: ' app-editor' ,
2424 template: ` <div #editor style="height: 700px"></div> ` ,
2525})
26- export class EditorComponent implements OnDestroy {
26+ export class EditorComponent implements OnInit , OnDestroy {
2727 @ViewChild (' editor' , { static: true }) editorRef! : ElementRef ;
2828 private superdoc: SuperDoc | null = null ;
2929
@@ -46,7 +46,7 @@ export class EditorComponent implements OnDestroy {
4646A reusable editor component with mode switching and export:
4747
4848``` typescript
49- import { Component , ElementRef , ViewChild , Input , OnDestroy } from ' @angular/core' ;
49+ import { Component , ElementRef , ViewChild , Input , OnInit , OnDestroy } from ' @angular/core' ;
5050import { SuperDoc } from ' superdoc' ;
5151import ' superdoc/style.css' ;
5252
@@ -62,7 +62,7 @@ import 'superdoc/style.css';
6262 <div #editor style="height: 700px"></div>
6363 ` ,
6464})
65- export class DocEditorComponent implements OnDestroy {
65+ export class DocEditorComponent implements OnInit , OnDestroy {
6666 @ViewChild (' editor' , { static: true }) editorRef! : ElementRef ;
6767 @Input () document! : File | string ;
6868 @Input () user? : { name: string ; email: string };
0 commit comments