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

Unknown provider: ngWebworkerProvider <- ngWebworker

Open LoganLehman opened this issue 8 years ago • 3 comments

Hi @mattslocum,

I keep receiving an unknown provider error from ngWebworker. My inclusion is here:

 var app = angular.module('insight', [
    'ngAnimate',
    'ui.bootstrap',
    'ngWebworker',
    'ui.router',
    'ui.sortable',
    'ngTouch',
    'toastr',
    'smart-table',
    "xeditable",
    'ui.slimscroll',
    'ngJsTree',
    'pdf-viewer',
    'angular-progress-button-styles',
    'insight.theme',
    'insight.pages',
    'insight.widgets',
    'insight.factories'
])

From there I inject it into a controller:

 angular.module('insight.widgets')
    .controller('ExcelTableController', ExcelTableController)
    .directive('excelTable', excelTable)

/** @ngInject */
function ExcelTableController($scope, $window, $http, ngWebworker) {
    var vm = this;

    vm.data = [];
    vm.fullData = [];
    vm.sheets = [];
    vm.columnNames = {};
    vm.columns = {};
    vm.worker = ngWebworker.create(function(bstr) {
        return XLSX.read(bstr, {
            type: "binary"
        });
    })
........
........

I have also tried using the standard fashion instead of ngInject:

  angular.module('insight.widgets')
    .controller('ExcelTableController', ['$scope', '$window', '$http', 'ngWebworker', ExcelTableController])
    .directive('excelTable', excelTable)

/** @ngInject */
function ExcelTableController($scope, $window, $http, ngWebworker) {
    var vm = this;

    vm.data = [];
    vm.fullData = [];
    vm.sheets = [];
    vm.columnNames = {};
    vm.columns = {};
    vm.worker = ngWebworker.create(function(bstr) {
        return XLSX.read(bstr, {
            type: "binary"
        });
    })
........
........

and I am still having no luck.

Any ideas?

LoganLehman avatar Aug 22 '16 23:08 LoganLehman

module 'insight' is different than module 'insight.widgets'. Try adding 'ngWebworker' to 'insight.widgets'.

mattslocum avatar Aug 23 '16 02:08 mattslocum

@mattslocum,

I already have. Still no luck. I am using wiredep in gulp to concatenate my bower components into one file, but for every other 3rd party library it has worked flawlessly.

LoganLehman avatar Aug 23 '16 15:08 LoganLehman

Change: controller('ExcelTableController', ['$scope', '$window', '$http', 'ngWebworker', ExcelTableController])

To: controller('ExcelTableController', ['$scope', '$window', '$http', 'Webworker', ExcelTableController])

BastienWW avatar Oct 21 '16 06:10 BastienWW