there is a question regarding referencing and injecting directives into different modules. The goal is to inject multiple directives located in separate files into one module, and then inject that common module to other places. I have multiple directives, defined in separate files, for example:
define(['angular'], function (angular) {
angular.module('ngCustomDirective')
.directive('ngCustomDirective', function () {
...
});
});
in separate file, I have:
define(['angular'], function (angular) {
angular.module('ngCustomDirective2')
.directive('ngCustomDirective2', function () {
...
});
});
after that the directive is referenced in another module (different file):
define(['angular','ngCustomDirective', 'ngCustomDirective2'], function (angular, ngCustomDirective, ngCustomDirective2) {
angular.module('directives', [ngCustomDirective, ngCustomDirective2]);
return 'directives';
});
next, this 'directives' module is injected into another module. The code above doesn't work. What I'm doing wrong here?