Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/400.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
Javascript 离子模式始终自动打开_Javascript_Angular_Ionic Framework - Fatal编程技术网

Javascript 离子模式始终自动打开

Javascript 离子模式始终自动打开,javascript,angular,ionic-framework,Javascript,Angular,Ionic Framework,我有一个表单放在模式中,它应该在用户点击按钮时打开,但它会在用户加载页面时自动打开 问题 我已经将模式导入到我的页面module.ts文件中,它会自动打开模式。如果我将其从模块页面中删除,则会出现以下错误: ERROR Error: Uncaught (in promise): Error: No component factory found for ContactSupplierPage. Did you add it to @NgModule.entryComponents? Error:

我有一个表单放在模式中,它应该在用户点击按钮时打开,但它会在用户加载页面时自动打开

问题 我已经将模式导入到我的页面module.ts文件中,它会自动打开模式。如果我将其从模块页面中删除,则会出现以下错误:

ERROR Error: Uncaught (in promise): Error: No component factory found for ContactSupplierPage. Did you add it to @NgModule.entryComponents?
Error: No component factory found for ContactSupplierPage. Did you add it to @NgModule.entryComponents?
所以现在的问题是:

如果我将模态添加到模块页面,它将自动打开 若我并没有将它添加到模块页面,那个么它会出错并且不会打开。 密码 list-detail.module.ts假设其中包含modal

list-detail.page.ts

list-detail.html

有什么想法吗?

解决了 我必须在app.module.ts文件中添加模态模块,而不是页面模块文件

现在一切正常

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    ContactSupplierPageModule, // here
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    CommonModule
  ],
  providers: [
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
希望它能帮助其他人。

我必须在app.module.ts文件中添加模态模块,而不是页面模块文件

现在一切正常

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    ContactSupplierPageModule, // here
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    CommonModule
  ],
  providers: [
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

希望它能帮助其他人。

对我来说,这很奇怪,因为我已经将模态模块安排在页面模块之前了

 ModalPageModule,
 MyPageRoutingModule,

changed to 

  MyPageRoutingModule
  ModalPageModule,

对我来说,这是很奇怪的,因为我已经把模态模块安排在页面模块之前了

 ModalPageModule,
 MyPageRoutingModule,

changed to 

  MyPageRoutingModule
  ModalPageModule,
 ModalPageModule,
 MyPageRoutingModule,

changed to 

  MyPageRoutingModule
  ModalPageModule,