I'm trying to use jszip in an angular service but it is not written using angular. I've looked at the answers to this question Inject non-angular JS libraries and this question How to make lodash work with Angular JS? which are both trying to get lodash to work in angular. I've tried creating a module like this
angular.module('jszip', [])
.constant('_', window._)
.run(function($rootScope) {
$rootScope._ = window._;
});
And injecting it into a service like this
app.factory('FileService', ['Restangular', 'DeviceService', 'jszip',
function FileUploadService(Restangular, DeviceService, jszip) {
// ....
}]);
but I get this error
angular.js:10147 Error: [$injector:unpr] Unknown provider: jszipProvider <- jszip <- FileService
Also I'm assuming the underscore is something specific for lodash? In general how do I add a non angular dependency?