angularjs - How to smartly include all the necessary files? -


right karma config has following files include:

    files: [         'vendor/vendor.js',         'vendor/angular-mocks/angular-mocks.js',         'src/components/security/index.js',         'src/components/security/authentication.js',         'src/components/security/login-controller.js',         'src/components/filters/index.js',         'src/components/filters/todate.js',         'src/components/services/index.js',         'src/components/services/alert.js',         'src/menu/index.js',         'src/menu/menu-controller.js',         'src/user/index.js',         'src/manage/index.js',         'src/manage/user/manage-user-controller.js',         'src/manage/channel/manage-channel-controller.js',         'src/stream/index.js',         'src/stream/stream-controller.js',         'src/messages/index.js',         'src/messages/messages-controller.js',         'src/app.js',         'src/**/*.spec.js'     ], 

the file vendor/vendor.js automatically created gulp task concatenating vendor files using bower config. it's own javascript code that's hard include because order matters great deal. index.js files within folder define module (and routes) , must loaded before individual files. , app.js has last.

so question how bit smarter, example glob first includes index.js files , others?

this requirejs for. can use in deployed code, can use tests.

if this, "karma.conf.js" ends being little shorter , less volatile. requirejs config file specifies dependency mapping. each test spec ends specifying dependencies needs, either in "declarative" fashion in "define" call, or manually through "require" function (you need latter deal circular reference problems).


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -