ng-webworker icon indicating copy to clipboard operation
ng-webworker copied to clipboard

Function in Webworker called only once

Open Nikcharn opened this issue 7 years ago • 1 comments

Hi, can you help me?

I created simple worker in controller:

var testWorker = Webworker.create(function() {return 5});
var count = 0;

$scope.runWorker() {
    testWorker.run().then(function() {
        count++;
        console.log(count);
    })
}

and in template I launch runWorker function:

<span class="button" ng-click="runWorker()">click me</span>

But runWorker function run only once. What am I doing wrong? To fix this problem, now I am creating worker ("Webworker.create(function() {return 5})") every time when I click on the button.

Nikcharn avatar Sep 20 '17 19:09 Nikcharn

If someone bump into this: a Webworker will always terminate if useHelper is not set.

hefler avatar Nov 23 '18 16:11 hefler