kittencup / angular2-ama-cn

angular2 随便问
692 stars 101 forks source link

如何不显示ng-component标签 #267

Closed coloz closed 6 years ago

coloz commented 6 years ago

添加的动态组件都带有ng-component标签,有没办法不要这个标签

jiayisheji commented 6 years ago

ng-component是拥抱了web component标准,自定义标签更有语义化,Angular做了很多处理,例如css里的:host

coloz commented 6 years ago

@jiayisheji 有没办法不要这个标签呢?

jiayisheji commented 6 years ago

不能,你可以用指令Directive,不要用组件Component了

coloz commented 6 years ago

@jiayisheji 感谢解答

jiayisheji commented 6 years ago

@coloz 可以用选择器

selector may be declared as one of the following:

不想用ng-component可以用div[ng-component] 不过这样tslint会报错 写在html的时候就像写指令一样