I need to pass an id of object from one component to another.
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let user">
<button mat-icon-button (click)="Edit()"><mat-icon>edit</mat-icon></button>
</mat-cell>
</ng-container>
Edit() function opens a form(another component) in which I would like to use something like user.id value. How can I pass the data between components? Is it possible to initialize a value and export it to another component in html code? Or is there any another solution? I would like to add that all the data is provided by service, MongoDB database.