Mutliple Module dependency

19 views
Skip to first unread message

Noman Yaqoob

unread,
Apr 29, 2015, 1:33:24 AM4/29/15
to ang...@googlegroups.com
Hello, I want to use more than one module in my TodoList,

var app = angular.module("TodoList",["ngMaterial"]) // this is working

if I do this it works but when I add a firebase module or any other in addition, my Material module doesn't load

can anyone tell me why its happening?

Kiran A

unread,
Apr 29, 2015, 2:03:43 AM4/29/15
to ang...@googlegroups.com
hi,

you cant use two module instead  You can create a top level module that will have your two modules as injected dependencies

var topmodule= angular.module('topmodule', ['firstmudule', 'secondmudule']);

and then in your html use: ng-app="topmodule"


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Kiran A

unread,
Apr 29, 2015, 2:05:05 AM4/29/15
to ang...@googlegroups.com
hi,

you cant use two module instead  You can create a top level module that will have your two modules as injected dependencies

var topmodule= angular.module('topmodule', ['firstmudule', 'secondmudule']);

and then in your html use: ng-app="topmodule"

Noman Yaqoob

unread,
Apr 29, 2015, 2:09:32 AM4/29/15
to ang...@googlegroups.com
I know I can't use multiple, I am trying to say that when I add two dependency in a single module like this,
var topmodule= angular.module('topmodule', ['firstmudule', 'secondmudule']);
my code doesnt work or you can say these module doesnt load.

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/YTt25DMF7HQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.

To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Regards,

Noman Yaqoob

Kiran A

unread,
Apr 29, 2015, 2:30:59 AM4/29/15
to ang...@googlegroups.com
when you add two dependency in single module it will work only when you mansion topmodele in html (ng-app="topmodule"
Reply all
Reply to author
Forward
0 new messages