How do you pass a dynamic data in Angular 7.2.4? I've been researching this, and I don't see simple answer. On SO and Github they're saying to create a shared services, use data object on Routes. It seems that Angular doesn't have a functionality like this in React:
<Route
path='/dashboard'
render={(props) => <Dashboard {...props} isAuthed={true} />}
/>
Here's my current code:
<table>
<tr>
<th>id</th>
<th>name</th>
<th>username</th>
<th>email</th>
<th>delete</th>
</tr>
<tr *ngFor="let user of users">
<td>
{{ user.id }}
</td>
<td>
{{ user.name }}
</td>
<td>
{{ user.username }}
</td>
<td>
{{ user.email }}
</td>
<td>
<!-- <input type="checkbox" /> -->
<button (click)="handleDeleteUser(user)">DEL</button>
</td>
<td>
<button [routerLink]="['/edit', user]"> <-- problem here
EDIT
</button>
</td>
</tr>
</table>
On /edit url, user obj will populate. I don't want to pass and Id also and make a query from the backend because data is already there I just need to pass it. Is there a way?
userobject has more data too.