小编D15*_*D15的帖子

如何在角度测试中检索ngClass的值?

这是我的component.html文件,在第二个span元素中包含ngClass属性:

<span class="container">
  <button mat-icon-button [disabled]="disabled" (click)="onButtonClicked()">
    <mat-icon>{{icon}}</mat-icon>
    <span class="badge" [ngClass]="((themes$ | async)[(activeTheme$ | async)].accent)" color="accent" *ngIf="badgeCount > 0">{{parseBadgeCount()}}</span>
  </button>
</span>
Run Code Online (Sandbox Code Playgroud)

jasmine angular

4
推荐指数
1
解决办法
3496
查看次数

标签 统计

angular ×1

jasmine ×1