0

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.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.