O'Reilly logo

ASP.NET Core: Cloud-ready, Enterprise Web Application Development by James Singleton, Valerio De Sanctis, Mugilan T. S. Ragupathi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required