Accessing properties from inside callback ES2015
<p>I'm using classes in ES2015 identical to the snippet below:</p>

<pre class="lang-js prettyprint-override"><code>class ProfileManager{
  constructor($http){
    this._http = $http;
    this.profile = {};
    }

  getUser(profile){
     this._http(`/api/users/${user.id}`).then(function(response){
        this.profile = response.data;    
        /*
         * Results in exception because "this uses the function's
         * "this" instead of the class' "this"
         */
     });
 }
</code></pre>



<p>I know I can remedy this by creating a profile variable outside of the class and using it in the class, but I was wondering if there was a cleaner or more preferred way to use class properties inside of a nested function or callback.</p>