Assuming AngularJS and although I never used Angular2+ I would assume it applies with that too (heck it would apply even in traditional desktop client-server calls), having all your data come in at once (if there are not hundreds of rows), is MUCH faster than having a data service call for the data each and every time it needs something.
If a page has 50 people on it, call the data service once to get the data (let's say around 3000 milliseconds) versus calling a data service 50 separate times even at 75 milliseconds would be 3750. Plus 50 separate data service calls puts a strain on the data server, database server, and even the browser. On Tuesday, August 29, 2017 at 12:07:24 PM UTC-4, Halldór Magnússon wrote: > > I am designing a page that shows a list of people and it displays each > person as a card. So I wanted to create a directive to handle that, to > isolate the html code that shows one person in one directive. Since I > already have the list and what's needed to show one person I wanted the > directive to just receives an object that has the person's information and > shows that. My co workers on the other hand think that each directive > should just get the id of the person and call the server to get that > information. For me this feels like for example if you had a datagrid to > display a list of users that you'd create a row component and that > component would just get the userId and get the information from the > server. What are your thoughts? > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" 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.
