I am trying to use the ng-file-upload directive ( https://github.com/danialfarid/ng-file-upload ) to add file upload functions to my project, but keep getting this error:
Error: [$injector:unpr] http:
at Error (native)
at http:
at http:
at Object.d [as get] (http://localhost:8000/static/editor/js/angular.min.js:38:394)
at http:
at d (http://localhost:8000/static/editor/js/angular.min.js:38:394)
at e (http://localhost:8000/static/editor/js/angular.min.js:39:161)
at Object.instantiate (http://localhost:8000/static/editor/js/angular.min.js:39:310)
at http:
at A.link (http://localhost:8000/static/editor/js/angular-route.min.js:7:268) <div ng-view="" ng-show="main.results==null" class="ng-scope">
I include the correct files in my index.html:
<script src="/static/editor/js/angular.min.js"></script>
<script src="/static/editor/js/ng-file-upload-shim.js"></script>
<script src="/static/editor/js/ng-file-upload.js"></script>
I declare this as my module:
(function() {
angular
.module('myApp', [
'ngRoute',
'ngAnimate',
'ngCookies',
'ngFileUpload'
]);
})();
But when I try to enter it into my controller, it throws the error above:
(function() {
angular
.module('myApp')
.controller('myController', myController);
myController.$inject = ['$routeParams',
'$compile',
'$scope',
'$interval',
'Upload'];
function myController($routeParams,
$compile,
$scope,
$interval,
Upload) {
....
I am using Angular 1.4.6 and ng-file-upload 9.0.14. I downloaded the files manually and included the specified .js files in the project directory. Could there be any additional dependencies that are included via bower or npm that I am missing?
Any help would be greatly appreciated!
UPDATE: ng-file-upload AngularJS 1.4.6 (https://angular-file-upload.appspot.com/#/1.4.6) , 1.4.6 ng .