我对某些使用ng-bootstrapngb-pagination
指令的组件进行了 Angular 测试。
现在,在我的测试中,我模拟了这个组件,如下所示:
// on next line I get: The selector should be prefixed by "<prefix>" (https://angular.io/guide/styleguide#style-02-07) (component-selector)
@Component({ template: ``, selector: 'ngb-pagination' })
class DummyNgPagination {
// some data here, not relevant in to the question
}
在放置@Component
注释的行中,我收到一个指向Style 02-07的tslint错误。
我尝试通过执行以下操作来禁用规则,但结果是一样的。
// tslint:disable-next-line:directive-selector
@Component({ template: ``, selector: 'ngb-pagination' })
如何为该特定行禁用该规则?
PS:
- 如果您想检查任何资源配置,这是真正的Angular 项目。
- 有一个类似的问题(kebab-case in angular 2 selectors (tslint)),但 OP 只是决定接受它。