Angular6 tr元件的角度6/T元件选择器
在早期版本中,我能够将组件选择器指定为属性Angular6 tr元件的角度6/T元件选择器,angular6,tslint,Angular6,Tslint,在早期版本中,我能够将组件选择器指定为属性 @Component({ selector: '[app-row]', ... }) export class RowComponent implements OnInit { ngOnInit() {} } "component-selector": [ true, ["element", "attribute"], "app", "kebab-case" ], HTML: <tr app-row><
@Component({
selector: '[app-row]',
...
})
export class RowComponent implements OnInit {
ngOnInit() {}
}
"component-selector": [
true,
["element", "attribute"],
"app",
"kebab-case"
],
HTML:
<tr app-row></tr>
现在我得到了lint错误:
错误:/path/to/row.component.ts[8,13]:组件“RowComponent”的选择器应用作元素()
我意识到我可以在元素中嵌套一个tr,但我并不总是能够控制样式,我个人不喜欢不必要的嵌套,通常会尽量避免
如果我总是使用元素选择器,那么如何将组件指定为“tr”元素。IE:
?实现这一点的适当方法是什么
注意:我已经查看了样式指南的链接,该部分没有介绍任何与我的特定用例类似的内容。我还尝试了按id选择,但得到了相同的lint错误。我更新了tslint.json,以允许组件选择器成为属性
@Component({
selector: '[app-row]',
...
})
export class RowComponent implements OnInit {
ngOnInit() {}
}
"component-selector": [
true,
["element", "attribute"],
"app",
"kebab-case"
],