I'm trying to send a @Input
decorator trough a <router-outlet>
, but can't seem to get the data in the child components, here's what I'm doing:
<!--parent route calls the outlet -->
<router-outlet [unit]="unit?.unit"></router-outlet>
// child route input decorator
export class ClassRoomComponent OnInit {
@Input() unit: string;
// router module
...
path: 'unidade/:unit',
component: UnitComponent,
children: [
{
path: 'turma/:classroom',
component: ClassroomComponent,
}
]
},
cosole.log returns me undefined
tought, why can't I send thata this way?