angularjs - Getting all directives that defined at module -


angularjs create [name]directive service each directive when define them.

are there ways can set of directives have created in specific module?

angular.module('mymodule',[]) .directive('aa',...) .directive('bb',...) .directive('cc',['alldirectiveservice',function(alldirectiveservice){ // can access directive here }]) 

in position declare submodule of main app module directives, that:

if (window.myapp == null) {   window.myapp = {     myapp: angular.module('myapp', [ 'directives']),     directives: angular.module('directives', []),   }; }  myapp.directives.directive('mydirective', [   function() {     return {       restrict: 'e',       replace: false     };   } ]); 

and suppose if console.log(myapp.directives); can see directives. havent tested think works.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -