As a newcomer to Angular4, I am currently exploring how to consume a HATEOAS API. My goal is to either pass an object that contains the self reference or the self reference link itself through the routing mechanism (for example, by clicking on an edit link in a list of objects). Unfortunately, there appears to be a lack of tutorials or libraries available for client-side HATEOAS implementations.
I believe that creating a custom UrlSerializer might be the solution, but I'm unsure of how to go about it. I am struggling with serializing the object or link while ensuring that it can be easily retrieved later on. Any suggestions that could help me move towards a working solution would be greatly appreciated, even if they do not involve using a UrlSerializer.
In essence, what I want is for the edit link to function like this (assuming 'account' is a complex object):
<table>
<tbody>
<tr *ngfor="let account in accounts">
<td>{{ account.username }}</td>
<td>{{ account.password }}</td>
<td>
<a [routerLink]="['/account', account]">edit</a>
</td>
</tr>
</tbody>
</table>