Here is my controller:
(function () {
'use strict';
angular
.module('app.dashboard', [ 'app.services.dashboardService', 'app.dashboard.eventTableDirective'])
.controller('DashboardController', DashboardController);
DashboardController.$inject = ['dashboardService', '$log', 'eventTableDirective'];
function DashboardController(dashboardService, $log) {
//.....
}
}());
and my directive:
(function () {
'use strict';
angular
.module('app.dashboard.eventTableDirective', [])
.directive('eventTableDirective', eventTableDirective);
function eventTableDirective() {
var directive = {
link: link,
templateUrl: 'eventTable.directive.html',
restrict: 'EA'
};
return directive;
function link(scope, element, attrs) {
/* */
}
}
}());
While completely same logic works with dashboardService, it fails with eventTableDirective and leads to this kind of error:
Error: [$injector:unpr] Unknown provider: eventTableDirectiveProvider <- eventTableDirective <- DashboardController