I'm getting false in the response from the api. If I console.log the result then it shows {}. What I want to do is, if the response is false then redirect to the homepage. But the false condition is not working. Below is my code:
this.sub = this.route.params.subscribe(params => {
this.token = params['Token'];
this.common.createAPIService('api/users/recoverpassword/ValidateLink?Token=' + this.token + '', '').subscribe((result: any) => {
console.log(result);
if (!result || result == {} || result == false) {
this.common.ShowNotification("Change Password", "Invalid Request", "error");
// setTimeout(function () {
// window.location.href = "#";
// }, 3000);
console.log(12);
this.zone.run(() => this.router.navigateByUrl("/home/" + "Mumbai"));
}
});
});
I tried !result, {}, even result == false but it's not working. The alert in condition or console.log not coming. Please help.