0

I am calling a service using angular as follows:

return $http.get('api/properties', { params: { id: id } });

In this case the resulting url is:

api/properties?id=2

So I am getting an error because I would need:

api/properties/2

What would be the correct way have this url?

1 Answer 1

2

sounds silly but concatenate the string will do

$http.get('api/properties/' + id);
Sign up to request clarification or add additional context in comments.

1 Comment

yes, that is the obvious solution ... i just wasn't sure if that would be the correct option ... it seems to be. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.