角js文件上传 - 未捕获的SyntaxError:意外的标记

角js文件上传 - 未捕获的SyntaxError:意外的标记

问题描述:

我想用角和PHP上传图像文件,但我在app.service越来越问题角js文件上传 - 未捕获的SyntaxError:意外的标记

错误行:app.service(“文件上传”,[” $ https:”开头,函数($ HTTPS :) {

代码

 app.service('fileUpload', ['$https:', function ($https:) { 
     this.uploadFileToUrl = function(file, uploadUrl){ 
      var fd = new FormData(); 
      fd.append('file', file); 

      $https:.post(uploadUrl, fd, { 
       transformRequest: angular.identity, 
       headers: {'Content-Type': undefined} 
      }) 

      .success(function(){ 
      }) 

      .error(function(){ 
      }); 
     } 
    }]); 

错误

question.js:20 Uncaught SyntaxError: Unexpected token : 
jquery.min.js:2 Uncaught Error: [$injector:modulerr] 
http://errors.angularjs.org/1.6.4/$injector/modulerr?..... 
at angular.js:38 
at angular.js:4920 
at q (angular.js:403) 
at g (angular.js:4880) 
at eb (angular.js:4802) 
at c (angular.js:1914) 
at Sc (angular.js:1935) 
at ue (angular.js:1820) 
at HTMLDocument.<anonymous> (angular.js:33367) 
at j (jquery.min.js:2) 

变化$https:$http

app.service('fileUpload', ['$http', function ($http) {