小编use*_*577的帖子

带有html的angular-tree-component样式节点

我正在使用angular 5和angular-tree-component https://github.com/500tech/angular-tree-component。我想为一个节点设置与其他节点不同的样式

import { Component, ViewChild} from '@angular/core';
import { TreeComponent } from 'angular-tree-component';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {

  @ViewChild('myTree')
  private tree: TreeComponent;

  nodes = [
    {
      id: 1,
      name: 'root1',
      children: [
        { id: 2, name: '<b>child1</b>' },
        { id: 3, name: 'child2' }
      ]
    }
  ];
}
Run Code Online (Sandbox Code Playgroud)

因此,问题在于,b标签要通过与角度进行消毒\lt b \gt \lt b \gt

如何以实用的角度生成HTML?

angular

2
推荐指数
1
解决办法
2510
查看次数

标签 统计

angular ×1