コンポーネントを別のコンポーネントでレンダリングするにはどうすればよいですか?このコンポーネントは、別のコンポーネントでレンダリングしない場合は正常に機能します...
例外:
Dashboard.module.ts
App.module.ts
ダッシュボード:
ここではコンポーネントを使用できません。
SiteComponent.ts
最後に、sitecomponentにはテーブルがあります
<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>
コンポーネントが内DashboardModule
でのみ使用されている場合は、コンポーネントをから削除し、DashboardModuleとのapp.module
両方のdeclarations
配列にあることを確認してくださいentryComponents
。
@NgModule({
declarations: [ SiteSearchComponent ],
entryComponents: [ SiteSearchComponent ]
})
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加