I get an error when trying to push from one page to another. When I try to push to same page, it won't give that error. Only i get error when pushing from one page to another. 'setRoot()' also not giving an error.
this.navCtrl.push( Page7 );
I have added the Page7 to app.module.ts.
import { NgModule } from '@angular/core'; import { IonicApp, IonicModule } from 'ionic-angular'; import { MyApp } from './app.component'; import { Page1 } from '../pages/page1/page1'; import { Page2 } from '../pages/page2/page2'; import { Page3 } from '../pages/page3/page3'; import { Page4 } from '../pages/page4/page4'; import { Page5 } from '../pages/page5/page5'; import { Page6 } from '../pages/page6/page6'; import { Page7 } from '../pages/page7/page7'; @NgModule({ declarations: [ MyApp, Page1, Page2, Page3, Page4, Page5, Page6, Page7 ], imports: [ IonicModule.forRoot(MyApp) ], bootstrap: [IonicApp], entryComponents: [ MyApp, Page1, Page2, Page3, Page4, Page5, Page6, Page7 ], providers: [] }) export class AppModule {}
This is a ionic 2 Application. It Gives this error.
EXCEPTION: Error in ./Page6 class Page6 - inline template:21:56 caused by: No component factory found for Page7
console error
I found the solution. You have to add the page that you are trying to push, to the parent directory. That should also be included in to the @NgModule also.
import {ApiServices} from '../../providers/api-services'; import { Visualizer } from '../Page7/Page7'; @Component({ selector: 'page-page6', templateUrl: 'page6.html', providers: [ ApiServices ], entryComponents:[ Page7 ] }) export class Page6 { tapped(event, id ) { this.navCtrl.push( Page7,{ id: id }); } }
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