title: Return value from a promise in Angular
body: <p>I am a little bit confused with Promises. I have the following provider in Ionic + Angular:</p>
  
  <pre><code>@Injectable()
  export class StorageProvider { 
  
    constructor( public storage:Storage ) {}
  
    save(keyname: string, data: any): Promise&lt;any&gt; {
      return this.storage.set(keyname, data);
    }
  
    retrieve(keyname: string): Promise&lt;any&gt; {
      return this.storage.get(keyname);
    }
  
    clear(): Promise&lt;void&gt; {
      return this.storage.clear();
    }
  
    delete(keyname): Promise&lt;any&gt; {
      return this.storage.remove(keyname);
    }
  
    isLogged() {
        return this.retrieve('user').then( value =&gt; { value ? true : false });
    }
  
  }
  </code></pre>
  
  <p>And in one of my components:</p>
  
  <pre><code>console.log(this.storage.isLogged()); 
  </code></pre>
  
  <p>The problem is that it returns the promise object and not <code>true</code> or <code>false</code></p>
  
  <p>If I change my component to:</p>
  
  <pre><code>this.storage.isLogged().then(function(data) { console.log(data)});
  </code></pre>
  
  <p>Then I get an output of <code>undefined</code></p>