Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use EditorView from codemirror/view with ngx-codemirror #325

Open
Uterr opened this issue Dec 14, 2023 · 4 comments
Open

How to use EditorView from codemirror/view with ngx-codemirror #325

Uterr opened this issue Dec 14, 2023 · 4 comments

Comments

@Uterr
Copy link

Uterr commented Dec 14, 2023

Codemirror documentation shows a way to create view:

let myView = new EditorView({
doc: '',
extensions: [placeholders],
parent: document.body
})

In this example there is a way to use extensions, but does ngx-codemirror allows to pass extensions? Or is there any way to attach extensions?

@scttcper
Copy link
Owner

What have you tried?

@Uterr
Copy link
Author

Uterr commented Dec 14, 2023

I am talking about this reference: https://codemirror.net/docs/ref/ first example.

I tried to attach to existing ngx-codemirro by passing existing native element to EditorView constructor
new EditorView({
parent: existingCodemirror
})
that I got from template from existing ngx-codemirror element with viewChild, but that did nothing

@scttcper
Copy link
Owner

make sure you're looking at the right v5 docs https://codemirror.net/5/

@nzbin
Copy link

nzbin commented Jun 1, 2024

I have created a CodeMirror 6 wrapper for Angular, please have a try.
https://github.com/acrodata/code-editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants