I have this function:
dosomething(): void {
this.service.check(this.person.name, this.person.name).subscribe(response => {
this.isGreatPerson = response == null ? false :response;
});
}
this.isGreatPerson
should get the response
(true or false) and if the response
is undefined
or null
, make this.isGreatPerson
false
. The solution should be in one line.
Thanks!