ng-webworker
ng-webworker copied to clipboard
Unknown provider: ngWebworkerProvider <- ngWebworker
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?
module 'insight' is different than module 'insight.widgets'. Try adding 'ngWebworker' to 'insight.widgets'.
@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.
Change: controller('ExcelTableController', ['$scope', '$window', '$http', 'ngWebworker', ExcelTableController])
To: controller('ExcelTableController', ['$scope', '$window', '$http', 'Webworker', ExcelTableController])