Is it possible to pass parameters in the routes like the example here - params: ['parameters']
I dont mean pass data in the Url but when I'm on pageone I can access the params in the route for this view.
import { RouterModule, Routes } from "@angular/router";
import { HomeComponent } from "../app/home.component";
import { PageOneComponent } from "../app/pageone.component";
import { AppComponent } from "../app/app.component";
const mainRoutes: Routes = [
{
path: "",
component: AppComponent,
resolve: {
app: AppResolverService
},
children: [
{
path: "",
component: HomeComponent
},
{
path: "/pageone",
component: PageOneComponent
params: ['parameters']
},
]
}
];
export const MAIN_ROUTE_MODULE = RouterModule.forRoot(mainRoutes);
params, trydata. Keep in mind that the data passed like this can only be static data. Ref: Routes.