有这个组件:
@Component({
moduleId: module.id,
selector: 'chart-cmp',
template: ''
})
export class ChartComponent implements OnChanges {...}
和HTML模板
<chart-cmp style="min-width:310px; height: 400px; max-width: 800px; margin: 0 auto;"
[typeId]="typeId" [username]="username" [grain]="grain"
(onResult)="onResult($event)"></chart-cmp>
它生成HTML(dom)
<chart-cmp style="min-width:310px; height: 400px; max-width: 800px;
margin: 0 auto;" ng-reflect-type-id="elec" ng-reflect-username="JTAMISIER">
.... content...
</chart-cmp>
但我希望<DIV>
代替<chart-cmp>
答案 0 :(得分:2)
改为使用属性选择器:
selector: '[chart-cmp]',
<强> HTML 强>
<div chart-cmp></div>