I want to pass data using routing by passing data directly in the routing, see example to be more clear. I try to do it this way to see all the possibilities to pass from the given.
In my example I want to pass the variable toto to another component
Thanks in advance.
one component
public toto:string = 'pass this data to two component'
routing.module
const routes: Routes = {
{
path: 'two',
component: TwoComponent,
data: toto // I have an error here that says cannot find 'toto
}
}