haochi / angular2-web-worker

Web worker for Angular 2
https://www.npmjs.com/package/angular2-web-worker
51 stars 10 forks source link

echo.js not found #5

Closed AlexanderPaule closed 7 years ago

AlexanderPaule commented 7 years ago

Hi. At startExternalRequest have an error GET http://localhost:4200/dist/app/echo.js 404 (Not Found). I have resolve it by commenting the line. I don't know if it might t be an issue. This line is important?

` startExternalRequest() { const promises = []; promises.push( this._webWorkerService.runUrl( "dist/app/echo.js", "marco" ) ); promises.push( this._webWorkerService.run( () => "polo", 0 ) );

      promises.forEach(promise => {
        let worker = this._webWorkerService.getWorker(promise);
        worker.addEventListener('message', event => {
            console.log('getWorker', event.data);
        });
    });

    Promise.all(promises)
        .then(response => console.log(response))
        .catch(error => console.error(error));
}

`

haochi commented 7 years ago

Please look at https://github.com/haochi/angular2-web-worker-example for the example. I should remove the example in this repo. Thanks.

AlexanderPaule commented 7 years ago

Ok. Thank you.