Using web workers with chained promises in angularjs