I tried installing newer version of Ionic 3. Once the installation completed with the default pages such as Home, about, and contact. I removed “navcontroller” from all the pages.
I have added routers in “app.module.ts”
Look at the code below:
import { RouterModule,Routes} from ‘@angular/router’;
import { AboutPage } from ‘…/pages/about/about’;
import { ContactPage } from ‘…/pages/contact/contact’;
import { HomePage } from ‘…/pages/home/home’;
Okay, why would you remove navController and why would you prefer the Angular2 Router over the Ionic Navigation method? Ionic’s navigation is build on their own navigation stack.
If you want to do something like that in Ionic, I advice you try the deeplinker that’s used to handle this for you. As far as passing params, Ionic provides an excellent way to pass params through navParams or by getting it from the url with a little help of the IonicPage decorator. All in all I don’t think mixing the Angular Router with Ionic is going to work very well. It’s not designed to use this router and the Ionic team is trying to make Ionic more PWA suitable (i.e. with deeplinker, ionicPage decorator, lazy loading etc).
We face issues when will use IonicPage decorator and Lazy loading. Angular 2 have the option to support routing concept. It is helpful when you try to figure out the issue exactly when we have used the router. Still Lazy loading is under development.
Yes that might be helpful, weren’t it the case there’s an entire discussion about this topic on the forum. You can find it over here:
I think searching through this topic is your best bet. But once again, the router isn’t implemented for a reason and the Ionic team has very good reasons for not implementing it. Let us know when you’ve figured it out.
I had this same issue in my app and it was caused by a “href=”#" in the link where I called my pages. My code was like that: <a href="#" *ngFor=“let cbo of cbos” (click)=“cboSelected()”…
I just removed the “href=”#" from the link and everything worked well.