Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass boolean values in HttpParams in post http request typescript/angular 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

like image 638
Liyakhat Ali Sheikh Avatar asked May 18 '19 13:05

Liyakhat Ali Sheikh


1 Answers

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

    body.set('paramStringName', booleanValueYouWantToPass.toString());
like image 87
VyK Avatar answered Nov 16 '22 20:11

VyK