Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function in Webworker called only once #41

Open
Nikcharn opened this issue Sep 20, 2017 · 1 comment
Open

Function in Webworker called only once #41

Nikcharn opened this issue Sep 20, 2017 · 1 comment

Comments

@Nikcharn
Copy link

Nikcharn commented Sep 20, 2017

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 Nikcharn changed the title Function in Webworker called only one time Function in Webworker called only once Sep 20, 2017
@hefler
Copy link

hefler commented Nov 23, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants