title: How to add the details of the return of method in table using angular JS
body: <p>I am uploading files using spring boot and angular Js, my java controllor return some details of file such as the date and the type and the inputs of the form wich are the name Of the uploader and the file , so when i click on import Report ,i can upload the file but i dont have the details added to the table , i have an empty row .So what am i doing wrong?</p>
  
  <p>here's my form</p>
  
  <pre><code>&lt;div class="col-sm-5 col-sm-offset-1"&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;name *&lt;/label&gt;
                              &lt;input type="text" name="NameOfUploader" class="form-control" required="required" ng-model="r.NameOfUploader"&gt;
                          &lt;/div&gt;
  
  
                              &lt;div class="form-group"&gt;
                              &lt;label&gt;file&lt;/label&gt;
                              &lt;input type="file" name="file" class="form-control" fileread="r.file"&gt;
                          &lt;/div&gt;                        
  
                          &lt;div class="form-group"&gt;
                              &lt;a  class="btn btn-primary btn-lg"  ng-click="upload()"&gt;Import File&lt;/a&gt;
                          &lt;/div&gt;
                                      &lt;table class="table"&gt;
                              &lt;tr&gt;
                                  &lt;th&gt;Id_file&lt;/th&gt;
                                  &lt;th&gt;NameOfUploader&lt;/th&gt;
                                  &lt;th&gt;DateOfUpload&lt;/th&gt;
                                  &lt;th&gt;TypeOfFile&lt;/th&gt;
                                  &lt;th&gt;File&lt;/th&gt;
                              &lt;/tr&gt;
                              &lt;tr ng-repeat="r in reports"&gt;
                                  &lt;td&gt;&lt;/td&gt;
                                  &lt;td&gt;{{r.NameOfUploader}}&lt;/td&gt;
                                  &lt;td&gt;{{r.DateOfUpload}}&lt;/td&gt;
                                  &lt;td&gt;{{r.TypeOfFile}}&lt;/td&gt;
                                  &lt;td&gt;{{r.file}}&lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;   
  
                      &lt;/div&gt; 
  
  
                      &lt;/form&gt;
  </code></pre>
  
  <p>Here's my java controller</p>
  
  <pre><code>@RequestMapping(value="/upload",headers=("content-type=multipart/*"),consumes = {"multipart/form-data"}, method=RequestMethod.POST)
          public @ResponseBody Option&lt;JSONType&gt; handleFileUpload(@RequestParam("NameOfUploader") String NameOfUploader,@RequestParam("file") MultipartFile file){
              if (!file.isEmpty()) {
                  try {
  
                  DetailsReport d2=new DetailsReport();
                  d2.setNameOfUploader(NameOfUploader);
                  d2.setTypeOfFile(file.getContentType());
                  d2.setDateOfUpload(new Date(new java.util.Date().getTime()));
                  d2.setFile(convert(file));
                  detailsReportRepository.save(d2);
                      byte[] bytes = file.getBytes();
                      BufferedOutputStream stream =
                              new BufferedOutputStream(new FileOutputStream(new  File("F:/FilesStore/" + d2.getId_file()+"-"+d2.getNameOfUploader())));
                      stream.write(bytes);
                      stream.close();
                     return JSON.parseRaw(d2.toString());
             } catch (Exception e) {
                 System.err.print("erreur");
             }
  
  
  }
              return null;
  
              }
  </code></pre>
  
  <p>Here's my Js controller</p>
  
  <pre><code>//Upload files
  $scope.upload=function(){
  
          var fd = new FormData();
          var url='http://localhost:8080/upload';
          fd.append("file", $scope.r.file);
          fd.append("NameOfUploader",$scope.r.NameOfUploader);
         $http.post(url,fd,{
             transformRequest: angular.identity,
             headers: {'Content-Type': undefined}
         })
         .success(function(data){
  
             $scope.reports.push(data);
             console.log(data);
             console.log($scope.reports);
         })
         .error(function(){
         });
  
  }
  </code></pre>
  
  <p>Any ideas please? I really need your help</p>