Let me set the stage for you:
- We have A.js, which defines the main module.
- We also have B.js, which is lazy-loaded after angular bootstrapping and contains a controller along with some directives.
Contents of A.js:
var APP = angular.module('app.hello', ['ui.router', 'ngAnimate', 'ngTable', 'ngSanitize', 'ngCsv']);
(function() {
APP.config(function ($controllerProvider, $compileProvider) {
APP.loadController = $controllerProvider.register;
APP.loadDirective = $compileProvider.directive;
});
})();
Contents of B.js:
(function() {
"use strict";
APP.loadController("dynamicDemoController", dynamicDemoController);
dynamicDemoController.$inject = ["NgTableParams", "ngCsv"]; // <-- error
function dynamicDemoController(NgTableParams, CSV) {
// ...
}
})();
I'm successfully injecting NgTableParams
, but I am facing issues while trying to inject the ngCsv
module. The console shows this error message:
Error: [$injector:unpr] Unknown provider: ngCsvProvider <- ngCsv <- dynamicDemoController
Any thoughts on what I might be overlooking?