title: AngularJS 2 ZoneAwarePromise instead a boolean value
body: <p>I have a base class in AngularJS 2 for restClient to call data from API with this method:</p>
  
  <pre><code>public getInfoDataBooleanRequest(url: string): InfoDataBoolean {
    return this.http.get(this.urlApiPrefix + url, this.createRequestOptions())
        .toPromise()
        .then(response =&gt; &lt;InfoDataBoolean&gt;response.json())
        .catch(this.handleError);
  }
  </code></pre>
  
  <p>where InfoDataBoolean is a class with two properties:</p>
  
  <pre><code>export class InfoDataBoolean {
      public data: boolean;
      public error: string;
  }
  </code></pre>
  
  <p>I have another class where I called my service method.
  This call is inside a method where I want to return the data from InfoDataBoolean, not the class InfoDataBoolean like this.</p>
  
  <pre><code>public isLogged(): boolean {
     return this.getInfoDataBooleanRequest('islogged').then(x =&gt; {
        let result: InfoDataBoolean = x;
  
        if(result.error !== "1") {
          console.log('Success is failed');
          return false;
        }
  
        return result.data;
     });
  }
  </code></pre>
  
  <p>The output of <code>console.log(isLogged())</code>:</p>
  
  <blockquote>
    <p>ZoneAwarePromise {__zone_symbol__state: null, __zone_symbol__value: Array[0]}</p>
  </blockquote>
  
  <p>But I want to return <code>true</code> or <code>false</code> from my method <code>isLogged()</code>.</p>
  
  <p>How can I do this?</p>