【发布时间】:2018-11-23 13:28:21
【问题描述】:
我正在为使用 ngx-bootstrap 的工具提示属性指令 (TooltipDirective) 的组件编写规范。我想调用tooltip的open方法来查看内容。但是当我尝试访问该指令时,我得到了我的组件。
const tooltip = fixture.debugElement.query(By.directive(TooltipDirective))
.componentInstance;
当我console.log(tooltip) 时,我得到了对被测组件的引用,而不是预期的工具提示指令。有什么方法可以访问属性指令吗?
【问题讨论】: