FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

More Usage Examples please · Issue #6 · acrodata/code-editor · GitHub

More Usage Examples please #6

Description

Your Readme basically only has
<code-editor [(ngModel)]="value" />
for a usage example.

Would be nice to just thro in a snippet of how to.... for instance... add a specific language you would like to use.

I had to use chatGPT to figure it out... and im not sure I even did it correctly..

is this right?

import { CodeEditor } from '@acrodata/code-editor';
import { LanguageDescription } from '@codemirror/language';
import  { javascript } from '@codemirror/lang-javascript';
import  { html } from '@codemirror/lang-html';

// IN TEMPLATE

<code-editor [ngModel]="code()" [languages]="languages"  [language]="'javascript'"  />

// IN CONTROLLER

languages = [
    LanguageDescription.of({ name: 'javascript', support: javascript({ typescript: true }) }),
    LanguageDescription.of({ name: 'html', support: html() }),
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL