What is the best way to pass a Laravel route variable into an AngularJS controller or service?
For example I have a route of domain.com/contacts/87 where 87 is the contact's ID, this route shows the view/edit frontend for the Contact model with ID of 87. I want Angular to somehow get the ID of 87 to make a call to the RestfulAPI to retrieve a JSON representation of the Laravel Contact model, it will also be used for update and delete requests.
Partial from my AngularJS Contact service:
show: function (id) {
var url = '/api/contacts/';
return $http({
url: url+id,
method: "GET"
});
},