ng2-ace-editor
ng2-ace-editor copied to clipboard
Issue while trying to use XML mode
Hi
I added following in package.json and angular.cli.json to add xml mode. I am using angular 5 package.json: "ng2-ace-editor": "0.3.1", "brace": "^0.11.1", "w3c-blob": "^0.0.1", "buffer": "^5.1.0", "base64-js": "^1.2.3", "ieee754": "^1.1.8" angular.cli: "../node_modules/ace-builds/src-min/ace.js", "../node_modules/ace-builds/src-min/theme-katzenmilch.js", "../node_modules/ace-builds/src-min/mode-xml.js", "../node_modules/ace-builds/src-min/worker-xml.js", "../node_modules/w3c-blob/index.js", "../node_modules/brace/index.js", "../node_modules/brace/mode/xml.js", "../node_modules/brace/worker/xml.js", "../node_modules/buffer/index.js", "../node_modules/base64-js/index.js", "../node_modules/ieee754/index.js"
The editor was set properly but not able to set the xml mode. The xml text is being displayed in single line instead of pretty xml
I am getting below error in console
Uncaught ReferenceError: module is not defined
at scripts.bundle.js:18
scripts.bundle.js:1 Could not load worker TypeError: e.split is not a function
at a.t.moduleUrl (scripts.bundle.js:1)
at new f (scripts.bundle.js:1)
at Mode.createWorker (webpack-internal:///../../../../brace/mode/xml.js:646)
at d.$startWorker (scripts.bundle.js:1)
at d.$onChangeMode (scripts.bundle.js:1)
at d.
Attached the screenshot of xml display. Can you please let me know what needs to be add .Also tried adding the import in the module
I have the same issue
console.js:35 Could not load worker TypeError: e.split is not a function
at a.t.moduleUrl (scripts.bundle.js:1)
at new f (scripts.bundle.js:1)
at Mode.createWorker (json.js:292)
at d.$startWorker (scripts.bundle.js:1)
at d.$onChangeMode (scripts.bundle.js:1)
at d.<anonymous> (scripts.bundle.js:1)
at a.t.loadModule (scripts.bundle.js:1)
at d.setMode (scripts.bundle.js:1)
at AceEditorComponent.setMode (component.js:111)
at AceEditorComponent.set [as mode] (component.js:100)
at updateProp (core.js:12619)
at checkAndUpdateDirectiveInline (core.js:12330)
at checkAndUpdateNodeInline (core.js:13893)
at checkAndUpdateNode (core.js:13836)
at debugCheckAndUpdateNode (core.js:14729)
at debugCheckDirectivesFn (core.js:14670)
at Object.eval [as updateDirectives] (CreateUpdateConfigurationComponent.html:151)
My .angular-cli.json
"scripts": [
"../node_modules/ace-builds/src-min/ace.js",
"../node_modules/ace-builds/src-min/theme-chrome.js"
],
My HTML
<ace-editor
class="config-json-editor"
[(text)]="config"
[theme]="'chrome'"
[mode]="'json'"
>
</ace-editor>
I am also seeing this warning, though the mode I'm using in this case is 'javascript'.