title: Angular 8 Http Post get boolean value from subscribe
body: <p>I've tried to get value out from <strong>subscribe</strong> of boolean true/false but i can't get value out, here is what i used so far.<br></p>
  <p>My Old method for http post.<br></p>
  <pre><code>this.http.post(HostedPathConst.HostedPath + `CompanyProfile/UpdateCustomersStatus`, fData)
  .subscribe(data =&gt; this.Success(data), err =&gt; this.Error(err)); 
  </code></pre>
  <p><code>this.Success(data)</code> and <code>this.Error(err)</code> are methods being called now, the new way i tried to get data out is this.<br></p>
  <pre><code>const fData = new FormData();
  fData.append('Id', Id.toString());    
  fData.append('IsActive', IsActive.toString());
  const test = this.http.post(HostedPathConst.HostedPath + `CompanyProfile/UpdateCustomersStatus`, fData)
    .subscribe(data =&gt; {
      this.Success(data);
      this.Switch = IsActive;
      return this.Switch;
    },
      err =&gt; {
        this.Error(err);
        this.Switch = !IsActive;
        return this.Switch;
      });
      console.log(test);//Subscriber {closed: false, _parentOrParents: null, _subscriptions: Array(1), syncErrorValue: null, syncErrorThrown: false, …}
      console.log(this.Switch);//undefined at first then gives opposite result like true gives false and vice versa
  </code></pre>
  <p>As <code>this.Switch = IsActive;</code> the boolean value to get data out it returns <strong>undefined</strong> at first then after wards it returns value <strong>false</strong> instead of <strong>true</strong> and vice versa.</p>