ngx-monaco-editor icon indicating copy to clipboard operation
ngx-monaco-editor copied to clipboard

Multiple instances

Open danielehrhardt opened this issue 7 years ago • 3 comments

Could you add a option to support multiple instances

danielehrhardt avatar Aug 14 '18 16:08 danielehrhardt

@atul-wizni

jesusvallez avatar Dec 05 '18 12:12 jesusvallez

@atul-wizni, Is it possible to add multiple instance of "[email protected]" in multiple tabs of same page?

image

event I saw the code of Monaco editor home page play ground, https://microsoft.github.io/monaco-editor/playground.html they are also configuring only 1 instance to support JS, CSS & HTML.

please let us know if there any way or we configure only one instance.

image

nileshsoni1994 avatar Oct 27 '20 12:10 nileshsoni1994

Multiple instances work fine!

When using it inside tabs it must be lazy loaded. Using Angular Material that means using an ng-template

<mat-tab-group>
  <mat-tab label="First">
    <ng-template matTabContent>
      <ngx-monaco-editor
        [(ngModel)]="editorData1"
        [options]="editorOptions"
      ></ngx-monaco-editor>
    </ng-template>
  </mat-tab>
  <mat-tab label="Second">
    <ng-template matTabContent>
      <ngx-monaco-editor
        [(ngModel)]="editorData3"
        [options]="editorOptions"
      ></ngx-monaco-editor>
    </ng-template>
  </mat-tab>
  <mat-tab label="Third">
    <ng-template matTabContent>
      <ngx-monaco-editor
        [(ngModel)]="editorData2"
        [options]="editorOptions"
      ></ngx-monaco-editor>
    </ng-template>
  </mat-tab>
</mat-tab-group>

https://material.angular.io/components/tabs/overview#lazy-loading

mvanderlee avatar Sep 02 '21 17:09 mvanderlee