Skip to content

Insert the Value in the Current Cursor Position Using ngx-monaco-editor-v2 #271

@Siva-Harish98

Description

@Siva-Harish98

Hi guys, I'm slightly stuck with a problem. I want to insert a value at the cursor position, but it's very difficult for me in ngx-monaco-editor-v2. I've searched a lot, but I haven't found any documentation regarding this in ngx-monaco-editor-v2.
Can you pls help me to find the cursor Position and How to Insert the value

HTML
<ngx-monaco-editor [options]="editorOptions" [(ngModel)]="code">

Ts file

import { Component } from '@angular/core';

@component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
editorOptions = {theme: 'vs-dark', language: 'javascript'};
code: string= 'function x() {\nconsole.log("Hello world!");\n}';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions