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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -