ionic2 写的代码里面,跳转的时候报了一个 No component factory found for “RechargeSucceed”  

recharge() {
        let actionSheet = this._actionSheetCtrl.create({
            title: '付款详情',
            buttons: [{
                text: '确认付款',
                handler: () => {
                    let navTransition = actionSheet.dismiss();
                    navTransition.then(() => {
                        this.nav.push(RechargeSucceed);
                    })
                }
            }]
        });
        actionSheet.present();
    } 

对应页面中的代码并没有错,在网上一查,发现是:app.module.ts中全面初始化并定义了项目中的模块,所以当跳转到详情页面的时候便新增了一个详情页的模块,此时没有及时更新app.module.ts中的内容。所以会报此错误。

解决办法:在app.module.ts 中引入新模块,并在declarations,entryComponents里面添加新模块即可。

 

相关文章:

  • 2021-09-16
  • 2021-07-03
  • 2022-01-17
  • 2021-11-28
  • 2021-12-29
  • 2022-12-23
  • 2021-09-19
  • 2021-07-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-02-26
相关资源
相似解决方案