7

I'm new to angular7/typescript i want to pass boolean value as a Httpparam, Is it possible ?

let body = new HttpParams();
body = body.set('name', string);
body = body.set('value', boolean);

Issue is how do i pass boolean value

1
  • its a valid question, i wonder why there are downvotes Commented Aug 21, 2019 at 2:02

1 Answer 1

12

It would help to know what you are trying to do. However, you could do this:

    body.set('paramStringName', booleanValueYouWantToPass.toString());
Sign up to request clarification or add additional context in comments.

Comments

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.