0

I just started to learn Angular JS Framework and I get this extremely weird doubt:)

After you name a module for instance - moduleName And this moduleName depends on - anotherModule

Then, you write:

   var myCoolApp = angular.module('moduleName', ['anotherModule']);

But if anotherModule depends on anotherAwesomeModule, should I write:

   var myCoolApp = angular.module('moduleName', ['anotherModule', 'anotherAwesomeModule'])

Or is it going to take care of itself ?? I am Wondering ..

1
  • Sorry if my question is Extreeeeeeeeemely Stupid . I just started to learn Angular JS Commented May 23, 2016 at 15:26

1 Answer 1

1

This

angular.module('anotherModule', ['anotherAwesomeModule']);
angular.module('moduleName', ['anotherModule']);

will work.

And it is a good thing to do

angular.module('anotherModule', ['anotherAwesomeModule']);
angular.module('moduleName', ['anotherModule', 'anotherAwesomeModule']);

if moduleName itself depends on anotherAwesomeModule. Even if anotherModule stops to depend on it, the code still works as intended.

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.