How to import router from @angular/router in ionic


#1

I have import {Router, ActivatedRoute, Params} from '@angular/router'; in my app.module.ts .

When I import

imports: [ 
RouterModule.forRoot(appRoutes,
       { enableTracing: true }
     )
]

I’m getting error as

Cannot find name ‘appRoutes’.

I’m new to this topic. Can someone help me?


#2

You might want to wait for Ionic 4, because the Angular router can’t be used with earlier versions.