我尝试使用适当的编辑体验来展示XML编辑器。我唯一期待的是正确的着色,褶皱和折叠。我使用了ng2-ace-editor lib。似乎由于语言选择失败着色和折叠在这里不起作用。
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
从https://github.com/fxmontigny/ng2-ace-editor自述文件中的代码示例中,您需要使用没有[mode]="'xml'"
部分的ace/mode
。