[AngularJS] Re: Two modules on the same page

2016-03-30 Thread mr . sean . boyce
Awesome, Thanks Tito. I didn't mean to take it down a different path like that. Bringing it back to how to format the angular setup on the front end. Would you recommend two separate angular modules (companies, contacts) and a service to share data? What data would I be sharing? Am I look

[AngularJS] Re: Two modules on the same page

2016-03-29 Thread Tito
I think it depends on so many things. but it would just be one call that could bring everything or it could be done in pieces (for performance issues) Maybe the initial load brings only companies and then as you click each company the subset of contacts are called based on companyID. You could d

[AngularJS] Re: Two modules on the same page

2016-03-29 Thread mr . sean . boyce
Hey Tito, Thanks for the reply. To answer your questions. It is full MEAN stack app. So node, express, and Mongo backend. Correct, it is setup as a REST web api. Would that route be front end and show company specific details and that company's respective contacts? (makes one call to ba

[AngularJS] Re: Two modules on the same page

2016-03-29 Thread Tito
Sean, I agree with Sander, service is the way to go. Question for you to attempt a good answer.What is your backend: mysql, mongod, mssql? Also are you getting your data via an rest api using for example: express.js? One of your routes could be /companyContacts which will join company and conta

[AngularJS] Re: Two modules on the same page

2016-03-29 Thread mr . sean . boyce
Hey Sander, Thank you for your response. That does make sense to me. So would it be something like this? //companies module angular.module('companies', ['contacts']); //contacts module angular.module('contacts',[]); So when I setup the html page via the 'companies' controller I should have

[AngularJS] Re: Two modules on the same page

2016-03-29 Thread Sander Elias
Hi Sean, The usual way to solve this, is load all modules you need in your app (your app being another module that includes the needed modules and is otherwise (as good as) empty. You can then access all services from all of your modules wherever you see fit. Conclusion, load all modules, and