title: Returning a promise value in Angular 2, Ionic 2
body: <p>I am familiarizing myself with Angular2, Ionic2 and
  maybe I am misunderstanding something but was hoping for assistance.</p>
  
  <p>I have a provider called 'CurrentUser' for the purpose of storing and getting LocalStorage data.</p>
  
  <pre><code>     getProfile(): any {
        this.local.get("user-profile").then((profile) =&gt; {
        var val = JSON.parse(profile);
        return val;
    });
  }
  </code></pre>
  
  <p>this function <code>getProfile()</code> returns a promise</p>
  
  <p>If I inject this provider into a component. How would I await the promise to to resolve before assigning the data when calling this function from the component?.</p>
  
  <pre><code>@Component({
     templateUrl: 'build/pages/book_meeting/book_meeting.html'
  })
   export class BookMeetingPage implements OnInit {
   constructor(public navCtrl: NavController, private _currentUser: CurrentUser) {
  }
  
  profile: IProfile;
  
     ngOnInit(): any {
     this.profile = this._currentUser.getProfile();
     console.log(this.profile);//returns undefined
    }
  }
  </code></pre>