I have a restful web service with the support of HATEOAS links. When I call "http://localhost:8080/v1/bookings/1225380?lock=true" link I got following resource URLs. I want to integrate these Hypermedia with my Angular2 application (recently upgraded to final version). I found few resources which were implemented with Angular1 with the support of Angular HAL (links - https://paulcwarren.wordpress.com/2015/04/03/role-based-spas-with-angularjs-and-spring-hateoas/, https://github.com/LuvDaSun/angular-hal/tree/master/src). But I am unable to found a resource for Angular2.
"links": [
{
"rel": "client",
"href": "http://localhost:8080/v1/clients/10000"
},
{
"rel": "passengers",
"href": "http://localhost:8080/v1/bookings/1225380/passengers"
},
{
"rel": "itinerary",
"href": "http://localhost:8080/v1/bookings/1225380/itinerary"
},
{
"rel": "self",
"href": "http://localhost:8080/v1/bookings/1225380?lock=true"
},
{
"rel": "clientBookingHistory",
"href": "http://localhost:8080/v1/bookings/1225380/clientBookingHistory/10000"
}
]
You can create an Injectable for this and use this class instead of the angular http class. Here you filter the links and than call http with the right link.
}
Provide this injector and add it to the constructor where you need it
Then you can simply call it like you normally would call the http class
Hope this helps:)