Closed nam-vuhoang closed 3 years ago
@nam-vuhoang The sanitized html is Angular preventing xss injection. If you really want to apply the html from string you need a custom template in the tree:
<tree-root [nodes]="nodes">
<ng-template #treeNodeTemplate let-node let-index="index">
<span [innerHtml]="node.data.name"></span>
</ng-template>
</tree-root>
I would still strongy suggest not using that and just adjusting the template to fit the input:
<tree-root [nodes]="nodes">
<ng-template #treeNodeTemplate let-node let-index="index">
<span><b>{{node.data.index}}.</b> {{node.data.name}}</span>
</ng-template>
</tree-root>
I would still strongy suggest not using that and just adjusting the template to fit the input:
<tree-root [nodes]="nodes"> <ng-template #treeNodeTemplate let-node let-index="index"> <span><b>{{node.data.index}}.</b> {{node.data.name}}</span> </ng-template> </tree-root>
@tobiasengelhardt : Thank you for this suggestion. It works for me!
I'd like to format node titles with HTML codes, for example
<b>${index}.</b> ${name}
, but they are automatically encoded with < and >.Is it possible to disable this HTML-encoding?