title: How to set a Component's property value from inside a FileReader event
body: <p>I have this component:</p>
  
  <pre><code>export class FileFormComponent {
    _base64: string;
  
   handleFile($event){
     var input = $event.target;
     var reader = new FileReader();
     reader.onloadend = function() {
       this._base64 = reader.result
     }
     reader.readAsDataURL(input.files[0]);
     console.log(this._base64);
   }
  }
  </code></pre>
  
  <p>The problem is the <code>console.log(this._base64)</code> logs <code>undefined</code>. It seems <code>this</code> inside the <code>onloadend</code> event does not refer to the component's context. how can I set the value of the <code>_base64</code> property from inside the <code>FileReader</code> <code>onloadend</code> event. </p>