Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 渲染组件B中的组件A_Angular_Angular Ui Router - Fatal编程技术网

Angular 渲染组件B中的组件A

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

如何在另一个组件中渲染组件? 当不在另一个中渲染时,此组件工作正常

例外情况:

仪表板模块.ts

应用程序模块.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>

场地
客户编号。
表号
调制解调器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以便快速响应,它解决了我的问题!投票支持我