How is one supposed to use addDependency to include external libraries? Consider this example:
- I need to include
lodash into my WW
- I create a service that returns the lodash object:
angular.module('ext.lodash', []).factory('_', function() {
// WWs don't have access to 'window', will it affect this return value?
return window._;
});
- I use
addDependency and expect it to be injected:
WorkerService.addDependency('_', 'ext.lodash', 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.0/lodash.min.js');
This later results in an DI error when calling createAngularWorker. What am I doing wrong? I consider adding external libraries one of the most important feature since they allow me to include relevant math and utility libraries.
How is one supposed to use
addDependencyto include external libraries? Consider this example:lodashinto my WWaddDependencyand expect it to be injected:This later results in an DI error when calling
createAngularWorker. What am I doing wrong? I consider adding external libraries one of the most important feature since they allow me to include relevant math and utility libraries.