zoukankan      html  css  js  c++  java
  • ionic2 Navigation实现报错:No component factory found for "MyComponent"

    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里面添加新模块即可。

  • 相关阅读:
    hdu 4525(数学)
    hdu 4524(模拟)
    hdu 4523(大整数)
    hdu 4517(递推枚举统计)
    hdu 4520
    hdu 4519(数学题)
    hdu 4514(树的直径+并查集)
    hdu 4510(模拟)
    hdu 2089(数位DP)
    hdu 4506(数学,循环节+快速幂)
  • 原文地址:https://www.cnblogs.com/viola-sh/p/6118140.html
Copyright © 2011-2022 走看看