admin管理员组文章数量:1025278
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 ponent 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({
ponent: TarefasDetalhePage,
ponentProps:{
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>{{tarefaentarios}}</p>
</ion-label>
</ion-item>
</ion-list>
That's my Structure:
Repo on github:
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 ponent 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({
ponent: TarefasDetalhePage,
ponentProps:{
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.entarios}}</p>
</ion-label>
</ion-item>
</ion-list>
That's my Structure:
Repo on github: https://github./tiagosilveiraa/PManager
Share Improve this question asked Mar 6, 2019 at 1:39 Tiago SilveiraTiago Silveira 2674 silver badges17 bronze badges2 Answers
Reset to default 5For opening a ponent
in a modal, you have to add the ponent
in the app.module.js
as a entryComponent
.
Your error
message shows that.
You have to edit the NgModule
in your tarefas.module.ts
.
Please add the rest of as needed.
@NgModule({
imports: [
MatDialogModule
],
declarations: [
ComponentName
],
providers: [
{ provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { hasBackdrop: true, closeOnNavigation: true } }
],
entryComponents: [
ComponentName
],
exports: [
ComponentName
],
})
export class Module {
}
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 ponent 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({
ponent: TarefasDetalhePage,
ponentProps:{
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>{{tarefaentarios}}</p>
</ion-label>
</ion-item>
</ion-list>
That's my Structure:
Repo on github:
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 ponent 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({
ponent: TarefasDetalhePage,
ponentProps:{
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.entarios}}</p>
</ion-label>
</ion-item>
</ion-list>
That's my Structure:
Repo on github: https://github./tiagosilveiraa/PManager
Share Improve this question asked Mar 6, 2019 at 1:39 Tiago SilveiraTiago Silveira 2674 silver badges17 bronze badges2 Answers
Reset to default 5For opening a ponent
in a modal, you have to add the ponent
in the app.module.js
as a entryComponent
.
Your error
message shows that.
You have to edit the NgModule
in your tarefas.module.ts
.
Please add the rest of as needed.
@NgModule({
imports: [
MatDialogModule
],
declarations: [
ComponentName
],
providers: [
{ provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { hasBackdrop: true, closeOnNavigation: true } }
],
entryComponents: [
ComponentName
],
exports: [
ComponentName
],
})
export class Module {
}
本文标签: javascriptNo component factory found for Opening a ModalStack Overflow
版权声明:本文标题:javascript - No component factory found for... Opening a Modal - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745527167a2154578.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论