如何删除在使用 angular 2 动画时自动添加的 ng-tns class

How to remove ng-tns class which is adding automatically while using angular 2 animation

@Component({
  ...
  animations: [
    trigger('slideInOut', [
      transition(':enter', [
        style({transform: 'translateY(-100%)'}),
        animate('200ms ease-in', style({transform: 'translateY(0%)'}))
      ]),
      transition(':leave', [
        animate('200ms ease-in', style({transform: 'translateY(-100%)'}))
      ])
    ])
  ]
})

我的代码中有类似这样的东西,可以在单击按钮时创建动画。

它会自动将 ng-tns class 之类的 ng-tns-c4-24 添加到代码中的许多标签中,这会影响测试脚本。

有什么方法可以禁止 class 自动添加?

从这个 ,angular material 添加那些 类。您可能需要编辑测试以过滤 类.