2

I have 2 components: ProcessComponent & ClientTypeComponent binded to routes.

const routes: Routes = [
    {
            {path: 'login', component: LoginComponent},
            {path: 'home', component: HomeComponent, canActivate: [AuthGuard]},
            {
                path: 'process', component: ProcessComponent, canActivate: [AuthGuard], children: [
                    {path: 'client-type', component: ClientTypeComponent, canActivate: [AuthGuard]}
                ]
            }

];

How can I just send a simple boolean value from /process/client-type to /process

I can't use neither data-binding or EventEmitter since I don't use nested components but nested routes.

There is probably a way but I can't find any answers.

Azoulay Jason
  • 2,787
  • 5
  • 21
  • 46
  • something like this (from the angular docs): `this.router.navigate(['/heroes', { id: heroId, foo: 'foo' }]);` or as already mentioned, use a service – Ric Mar 28 '18 at 10:24

2 Answers2

1

try this i think it's duplicate of How do I pass data to Angular routed components?

chirag sorathiya
  • 1,223
  • 8
  • 29
0

You should use service to get the value. You store the value in service before routing to 'client-type'. Get the value in ngOninit of ClientTypeComponent

Basavaraj Bhusani
  • 5,375
  • 2
  • 16
  • 24