Multiple components instances

The first thing we need to do is to configure the AppComponent HTML template to make it render a couple more <quiz-list> component tags; while doing that, we also need to find a way to uniquely identify them in order to issue a different behavior for each instance, including latest items, most viewed items, and random items.

Open the /ClientApp/app/components/home/home.component.html file and update our preceding code in the following way (added/modified lines are highlighted):

<h1>Greetings, stranger!</h1><p>This is what you get for messing up with .NET Core and Angular.</p><quiz-list class="latest"></quiz-list><quiz-list class="byTitle"></quiz-list><quiz-list class="random"></quiz-list>

Then, add a home.component.css ...

Get ASP.NET Core 2 and Angular 5 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.