Skip to content

Commit

Permalink
Add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pzdr7 committed Apr 14, 2024
1 parent f95e270 commit 25d4fe5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export class MonacoEditorComponent implements OnInit, OnDestroy {
elementRef: ElementRef,
renderer: Renderer2,
) {
/*
* The constructor injects the editor along with its container into the empty template of this component.
* This makes the editor available immediately (not just after ngOnInit), preventing errors when the methods
* of this component are called.
*/
this.monacoEditorContainerElement = renderer.createElement('div');
renderer.addClass(this.monacoEditorContainerElement, 'monaco-editor-container');
renderer.addClass(this.monacoEditorContainerElement, 'monaco-shrink-to-fit');
Expand Down

0 comments on commit 25d4fe5

Please sign in to comment.