Angular 渲染组件B中的组件A
如何在另一个组件中渲染组件? 当不在另一个中渲染时,此组件工作正常 例外情况: 仪表板模块.ts 应用程序模块.ts 仪表板: 无法在此使用组件 SiteComponent.ts 最后sitecomponent有一个表Angular 渲染组件B中的组件A,angular,angular-ui-router,Angular,Angular Ui Router,如何在另一个组件中渲染组件? 当不在另一个中渲染时,此组件工作正常 例外情况: 仪表板模块.ts 应用程序模块.ts 仪表板: 无法在此使用组件 SiteComponent.ts 最后sitecomponent有一个表 <table datatable datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" > <caption> </caption> <thead
<table datatable datatable [dtOptions]="dtOptions"
[dtTrigger]="dtTrigger" >
<caption> </caption>
<thead>
<tr>
<th>Site</th>
<th>Customer No.</th>
<th>Meter S.No</th>
<th>Modem ID</th>
<th>Instrument Type</th>
<th>Instrument No</th>
<th>Region</th>
<th>Zone</th>
<th>Category</th>
<th>SP Id</th>
<th>SP Type</th>
<th>Meter Type</th>
<th>Address</th>
<th>Site ID</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let tbl of sites$">
<td>{{tbl.site_name}}</td>
<td>{{tbl.customer_id}}</td>
<td>{{tbl.meter_serial_no}}</td>
<td>{{tbl.device_id}}</td>
<td>{{tbl.device_type}}</td>
<td>{{tbl.Evc_Serial_No}}</td>
<td>{{tbl.region_name}}</td>
<td>{{tbl.zone_name}}</td>
<td>{{tbl.Category}}</td>
<td>{{tbl.Service_Point_Id}}</td>
<td>{{tbl.Serv_Point_type}}</td>
<td>{{tbl.meter_type}}</td>
<td>{{tbl.Address}}</td>
<td>{{tbl.site_id}}</td>
</tr>
</tbody>
</table>
场地
客户编号。
表号
调制解调器ID
仪器类型
文书编号
区域
区
类别
SP Id
SP型
仪表类型
地址
站点ID
{{tbl.site_name}
{{tbl.customer_id}
{{tbl.仪表\u序列号}
{{tbl.device_id}
{{tbl.device_type}
{{tbl.Evc_Serial_No}
{{tbl.地区名称}
{{tbl.zone_name}
{{tbl.类别}
{{tbl.Service_Point_Id}
{{tbl.Serv_Point_type}
{{tbl.meter_type}}
{{tbl.Address}
{{tbl.site_id}
如果该组件仅在仪表板模块中使用
,请将其从应用程序模块中删除
,并确保它位于仪表板模块和入口组件的声明中
@NgModule({
declarations: [ SiteSearchComponent ],
entryComponents: [ SiteSearchComponent ]
})
此错误被抛出“Component SiteSearchComponent不是任何NgModule的一部分,或者该模块尚未导入到您的模块中”。将您的仪表板模块放入app module的导入部分非常感谢@dince以便快速响应,它解决了我的问题!投票支持我