Reputation: 199
is possible I start my angular module without some dependency?
it's my angular.module
angular.module("app", [
'ngSanitize', 'ngAnimate', 'ui.router', 'ngMaterial',
'ngRoute', 'ngCookies', 'NgSwitchery',
'ngCkeditor', 'angularFileUpload',
]);
I would like not use, they're required on 1st. loading. 'NgSwitchery', 'ngCkeditor', 'angularFileUpload'
Thank you.
Upvotes: 0
Views: 118
Reputation: 88
yes, you could use condition to pass dependency.
var dependencyArray = ['dep1', 'dep2'];
if (someCondition) {
dependencyArray = ['dep1', 'dep2', 'dep3', 'dep4'];
}
angular.module('app',dependencyArray);
You might need requireJS if you're trying to load them at different times.
Upvotes: 2