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:

  1. Adding two more Angular components that are very similar to the ItemListComponent one.
  2. 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 and Angular 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.