Deepanjan Deepanjan - 27 days ago 21
AngularJS Question

"Uploader" must be an instance of FileUploader

I referred this: https://github.com/nervgh/angular-file-upload/tree/version-3.0.0-alpha

angular.min.js:14540 TypeError: "Uploader" must be an instance of FileUploader
at link (http://localhost:8080/services/angular-file-upload.js:1874:24)
at invokeLinkFn (http://localhost:8080/lib/js/angular.min.js:10445:8)
at nodeLinkFn (http://localhost:8080/lib/js/angular.min.js:9733:9)
at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8712:10)
at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
at publicLinkFn (http://localhost:8080/lib/js/angular.min.js:8567:9)
at link (http://localhost:8080/lib/js/angular-route.js:1053:5) <input type="file" nv-file-select="" uploader="uploader" multiple="">

Answer

FileUploader should be in controllers global scope in order to make an object respective to FileUploader. I made a factory and used it throughout the controller.

Comments