Skip to content

Commit 85c05a1

Browse files
committed
fix(docs): add OnInit interface to Angular doc examples
1 parent 9f68bf0 commit 85c05a1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/docs/getting-started/frameworks/angular.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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';
1919
import { SuperDoc } from 'superdoc';
2020
import '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 {
4646
A 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';
5050
import { SuperDoc } from 'superdoc';
5151
import '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

Comments
 (0)