title: Can't upload file and convert it to base64string
body: <p>I'm trying to upload file, then convert it to base64 string and add to object. but it seems did'nt work.
  console.log() every time show empty object</p>
  
  <pre><code>&lt;input type="file" (change)="onChange($event)" accept="image/jpeg, image/png" /&gt;
  &lt;input type="submit" value="send" (click)="upload()" /&gt;
  </code></pre>
  
  <p>functions:</p>
  
  <pre><code>onChange(fileInput: any) {
      let image: any = fileInput.target.files[0];
      let reader: FileReader = new FileReader();
  
      reader.onload = () =&gt; {
          reader.readAsDataURL(image);
  
          let photo: AddPhoto = new AddPhoto();
          photo.base64Image = reader.result;
          this.product.photos = [];
          this.product.photos.push(photo);
      };
  }
  
  upload() {
      console.log(this.product);
  }
  </code></pre>