ng2-ace-editor由于语言(模式)失败而无法显示颜色和折叠

时间:2019-03-01 07:07:43

标签: xml typescript angular7 ace-editor xml-editor

我尝试显示具有适当编辑经验的XML编辑器。我只希望正确的着色,缩进和折叠。我使用ng2-ace-editor lib。似乎由于语言选择失败而无法在此处进行着色和折叠。


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'">


结果

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

1 个答案:

答案 0 :(得分:0)

根据https://github.com/fxmontigny/ng2-ace-editor自述文件中的代码示例,您需要使用[mode]="'xml'"而不使用ace/mode部分。