Closed AdamsContreras999 closed 2 days ago
You are importing CommonModule, as well as a bunch of Material Modules, what's the concern about Code Editor? can you import it the same way?
You are importing CommonModule, as well as a bunch of Material Modules, what's the concern about Code Editor? can you import it the same way?
That's right, I import those necessary modules into the component because it is a standAlone component, and because I need those modules for that component to work, but when I import, but code editor cannot be imported there, I attached the error that returns in the image, if I import CodeEditorModule does work but when I want it to work offline like it is in the img it doesn't work
@DenysVuika
I have the same issue, i.e. importing into a standalone component
So what I did was create a separate module, and imported that module into my standalone component
So it now at least compiles
However at runtime, i now get the following error:
TypeError: Cannot read properties of undefined (reading 'editor')
at _CodeEditorService.createModel (ngstack-code-editor.mjs:107:24)
at _CodeEditorComponent.setupEditor (ngstack-code-editor.mjs:533:38)
at _CodeEditorComponent.<anonymous> (ngstack-code-editor.mjs:522:10)
at Generator.next (<anonymous>)
at chunk-R7GQRDZ6.js?v=5ae53e92:49:61
at new ZoneAwarePromise (zone.js:2702:25)
at __async (chunk-R7GQRDZ6.js?v=5ae53e92:33:10)
at _CodeEditorComponent.ngAfterViewInit (ngstack-code-editor.mjs:521:27)
at callHookInternal (core.mjs:5136:14)
at callHook (core.mjs:5163:13)
and this is the line causing the problem:
createModel(value, language, uri) {
return this.monaco.editor.createModel(value, language, this.monaco.Uri.file(uri));
}
I'm gonna keep fiddling to see if i can figure this out
after some digging i've found that the event triggered after the code box is loaded, does not return monaco
codeEditorService.loaded.subscribe(event => {
this.setup(event.monaco);
});
So when it tries to setup, it passes through a null
value, and that causes the other errors
after some digging i've found that the event triggered after the code box is loaded, does not return monaco
codeEditorService.loaded.subscribe(event => { this.setup(event.monaco); });
So when it tries to setup, it passes through a
null
value, and that causes the other errors
please @DenysVuika can you help us?
The component is fully standalone with the 9.0.0 release: https://github.com/ngstack/code-editor/releases/tag/v.9.0.0
Please check the updated readme or the standalone apps (single/multiple editors)
import assets of monaco error with component standAlone
and also return error when call ngs
please can you update documentation or write in this ticket how implement the editor with standAlone Components?
this problem evit works good this editor
I have -angular 18.0.1
"@ngstack/code-editor": "^7.2.0",
@DenysVuika i hope can you help me