I'm having trouble uploading an image file using Angular and PHP, specifically at the app.service
Error line: app.service('fileUpload', ['$https:', function ($https:) {
Code
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(){
});
}
}]);
Error
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)