小编Asi*_*ali的帖子

指令中的主机属性是什么以及如何知道这些细节

嗨,我使用 angular 8 和 ng-bootstrap 在我的项目中添加表
我发现这段代码我不太理解

  @Directive({
  selector: 'th[sortable]',
  host: {
    '[class.asc]': 'direction === "asc"',
    '[class.desc]': 'direction === "desc"',
    '(click)': 'rotate()'
    }
  })
Run Code Online (Sandbox Code Playgroud)

谁能告诉我代码说什么?
以及选择器中的“th”是什么意思。
还主机我可以将其更改为其他内容,因为编辑说的是,它是旧属性还是什么
谢谢大家

angular angular8

4
推荐指数
2
解决办法
4302
查看次数

标签 统计

angular ×1

angular8 ×1