I am using angular and I have two children components and I wanna pass data to them. Here is how I wrote my code: This is the home template
<div class="myCard">
<mat-card style="width: 500px;">
<mat-card-title style="display: flex; align-items: center; justify-content:space-between">
<span>Employees</span>
<button mat-raised-button color="primary" routerLink="/home/add-employee">Add</button>
</mat-card-title>
<router-outlet ></router-outlet>
</mat-card>
</div>
Then on the <router-outlet></router-outlet>
that's where the children components show. I know how to pass data to child if I included only one child component like <app-child [data]="data"></app-child>
in place of <router-outlet></router-outlet>
on the code above. So I wanna know how can I achieve this the way I want
Update Thanks guys, but I found the answer here