ng-webworker
ng-webworker copied to clipboard
Can not inject services
I want to call a service injected in directive ($compile for example) but i don't know how. I try to pass this service as an param but got the error with Post message 'An object could not be cloned"
I also met this problem,and have you resolved it
Can you post an example?
@mattslocum I have same issue. so I wanna call the service in webworker but it's not working. check out the following example, please.
function setEvent(event) {
console.log('event', event);
EventService.set(event)
.then(function (result) {
return true;
}).catch(function(error) {
return error;
});
var setEventWorker = Webworker.create(setEvent);
setEventWorker.run(event).then(function(result) {
console.log('result', result);
});
EventService is the service I wanna use in the controller's webworker.
@mattslocum I have same issue. so I wanna call the service in webworker but it's not working. check out the following example, please.
function setEvent(event) { console.log('event', event); EventService.set(event) .then(function (result) { return true; }).catch(function(error) { return error; }); var setEventWorker = Webworker.create(setEvent); setEventWorker.run(event).then(function(result) { console.log('result', result); });
EventService is the service I wanna use in the controller's webworker.
How do you slove this issue? I also have the same problem as yours. I have a angularjs $filter function, it can't be called in the webworker. It 'll show $filter is not define, but i don't know how to inject the $filter function to the webworker.