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 back end to grab everything?) Regarding the service, would that be contacts service that could be injected into the companies module and would share respective contacts for the company? Would the contacts module be a dependency of companies modules still or would they be separate modules that share contact data via the contacts service? Thanks again for the help! Sean On Tuesday, March 29, 2016 at 12:22:29 PM UTC-4, Tito wrote: > > 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 contacts > > That would be my approach > > On Tuesday, March 29, 2016 at 9:05:58 AM UTC-7, [email protected] wrote: >> >> 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 access to the 'contacts' $scope ? When I am on a specific company >> page I'll know the company id and can make a request to my api to gather >> just the contacts associated with that company and display them on the same >> page? >> >> Thanks again for your help! >> Sean >> >> On Tuesday, March 29, 2016 at 6:12:25 AM UTC-4, Sander Elias wrote: >>> >>> 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 communicate between components >>> <https://docs.angularjs.org/guide/component>through services. >>> >>> If you still have questions, don't hesitate to ask them! >>> >>> Regards >>> Sander >>> >> -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
