angularjs query params routing code example
Example 1: in angular how to get router url without query params
this.router.url.split('?')[0]
Example 2: angular routing url params
const appRoutes: Routes = [
{ path: 'crisis-center/:param1', component: CrisisListComponent },
{ path: 'hero/:param2', component: HeroDetailComponent },
];
@NgModule({
imports: [
RouterModule.forRoot(
appRoutes,
{ enableTracing: true } // <-- debugging purposes only
)
// other imports here
],
...
})
export class AppModule { }