Adding additional lists
Our welcome page isn't done yet. Two out of three item lists are yet to be done, at least on the client side. We're talking about the most viewed items and the randomly picked ones, so let's add them to the loop. We basically have two ways to do this:
- Adding two more Angular components that are very similar to the
ItemListComponent
one. - Extending our
ItemListComponent
and making it configurable, thereby making it able to handle all the three item listings.
Adding two more components would be rather easy. We could clone the item-list.component.ts
file a couple of times, change the inner method of the two new files to make it fetch the relevant data from the other Web API method (respectively, GetMostViewed()
and GetRandom() ...
Get ASP.NET Core: Cloud-ready, Enterprise Web Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.