title: plugin ng2-file-upload: how to return the response
body: <p>Angular2:</p>
  
  <p>I have a <strong>component</strong> and a <strong>service</strong>. Component calls service and it must return the response. The problem is that I don't know how to return the response. My <strong>component</strong> is like:</p>
  
  <pre><code>uploadFile(docId: any) {
          let pos = this.uploader.queue.length-1;
          //We pick the last one
          this._uplService.uploadDoc(this.uploader.queue[pos], docId, this.innerText)
      }
  </code></pre>
  
  <p>The <strong>service</strong> does this thing:</p>
  
  <pre><code>uploadDoc(file: FileItem, docId : any, title: String){
      let headers = this._httpWrapper.genetareAuthHeader("path", "POST");
      let user = this._userService.getUser();
  
      file.url = user.config.apiUrl+"path?options="+user.options;
      file.upload();
      file.onSuccess = function(response: string, status: number, headers: ParsedResponseHeaders) {
        console.log(response);
      }
      file.onError = function(response: string, status: number, headers: ParsedResponseHeaders) {
        console.error(response);
      }
  </code></pre>
  
  <p>My problem is to return <strong>response</strong> and <strong>error</strong> from the service to the component. I tried to do an observable from promise, from response etc. but observables are really hard and all the times I tried, 'uploadDoc' returned a <strong>function</strong> (file.onSuccess or file.onError) not the <strong>value</strong> returned by the function (response).</p>