I have one page that should be loaded inside a modal, this page is child from other page (I think it does not matter, but...) the point is that when I try to create a modal I receive the error below
ERROR Error: Uncaught (in promise): Error: No component factory found for TarefasDetalhePage. Did you add it to @NgModule.entryComponents?
But, when I go to my AppModule to put that page into the entryComponents I got this error:
Component TarefasDetalhePage is not part of any NgModule or the module has not been imported into your module.
The call of the modal is on my HomePage.ts:
async showModal(id){
const modal = await this.modalController.create({
component: TarefasDetalhePage,
componentProps:{
custom_id: id
}
});
modal.present();
}
Here's the markup:
<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>
That's my Structure:
Repo on github: https://github.com/tiagosilveiraa/PManager
For opening a component
in a modal, you have to add the component
in the app.module.js
as a entryComponent
.
Your error
message shows that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With