【发布时间】:2019-07-27 14:14:49
【问题描述】:
我有一个页面应该加载到模式中,这个页面是其他页面的子页面(我认为没关系,但是......)关键是当我尝试创建模式时我收到错误下面
ERROR Error: Uncaught (in promise): Error: No component factory found for TarefasDetalhePage. Did you add it to @NgModule.entryComponents?
但是,当我转到我的 AppModule 将该页面放入 entryComponents 时,我收到了这个错误:
Component TarefasDetalhePage is not part of any NgModule or the module has not been imported into your module.
模态的调用在我的 HomePage.ts 上:
async showModal(id){
const modal = await this.modalController.create({
component: TarefasDetalhePage,
componentProps:{
custom_id: id
}
});
modal.present();
}
这是标记:
<ion-list *ngIf="interna === true" >
<ion-item (click)="showModal(tarefa.id)" routerDirection="forward" detail *ngFor="let tarefa of tarefasInternas" class="in-list item ion-focusable item-label hydrated">
<ion-label>
<h2>#{{tarefa.numero}} - {{tarefa.descricao}}</h2>
<h3>{{tarefa.inicio}} - {{tarefa.fim}}</h3>
<p>{{tarefa.comentarios}}</p>
</ion-label>
</ion-item>
</ion-list>
这就是我的结构:
github 上的回购: https://github.com/tiagosilveiraa/PManager
【问题讨论】:
标签: javascript angular typescript ionic-framework