angularjs - How do I load angular modules, that are common and dynamic between pages? -
i have site developed multiple developers has multiple pages. each "page" initializes angular calling angular.module(etc).
my question is, pages share modules, , pages use specific modules. best practice achieve this? trust developers insert correct modules needed across site (i.e. google analytics) or create 1 call shared pages loads modules. , there way both? such as, initilize modules needed across pages , then, load specific modules dynamically on respective pages.
i make 1 global module loaded each individual app, modules 'nganimate' loaded... global module initialize functionality common pages, such google analytics.
this requires policing on developers involved, practice via code reviews, etc.
example page:
angular.module('individualpage', [ 'globalmodule', 'custompagemodule' ]).config( // etc );
global module:
angular.module('globalmodule', [ 'googleanalytics' ]).config( // etc );
Comments
Post a Comment