I was learning about Spring REST HATEOAS. But, I am confused about how we use it on the client end..
I mean, let's say I want write a client app using Angular JS. So now I don't have to hardcode the URL's to make REST API calls? And instead i'd use the "rel" attribute that gets returned?
for example, from angular JS,
- I'd use the root URL "/products"
- It returns links to individual products (Which I believe will be populated on UI)
- User selects a product and angular will fetch the product details, along with relevant links to that product to delete, edit, etc..
- If user clicks on delete, Angualar will use the URI specified in "rel=delete" to delete that product..
Is my understanding correct? Is there a sample angular code, that doesn't hardcode URI but use the rel attribute?