xmltypescriptangular7ace-editorxml-editor

ng2-ace-editor doesn't show colour and folded due to language(mode) fail


I try to show an XML editor with proper editing experiance. Only thing I'm expecting is proper coloring, indentaion and folding. I used ng2-ace-editor lib. seems due to language selection fail coloring and folding are not working here.


component.ts

this is the code in component.ts

component.html

  <ace-editor
[(text)]="xmlToView"
[options]="options"
[durationBeforeCallback]="1000"
[theme]="eclipse"
[mode]="'ace/mode/xml'">


Result

sasc This is the result I get. I want to show the folding as well as color


Solution

  • From the code example in https://github.com/fxmontigny/ng2-ace-editor readme, you need to use [mode]="'xml'" without the ace/mode part.