The template file

From Solution Explorer, right-click on the /ClientApp/app/components/quiz/ folder and add a new HTML file; call it quiz-list.component.html, and replace the sample code with the following:

<h2>{{title}}</h2><ul class="quizzes">    <li *ngFor="let quiz of quizzes"        [class.selected]="quiz === selectedQuiz"        (click)="onSelect(quiz)">        <span>{{quiz.Title}}</span>    </li></ul>
It's important to understand that we're free to use any filename we want for the template file, as long as it reflects the value we used in the templateUrl property within the quiz-list.component.ts file. We can even share the same template among two (or more) different components. However, the Angular best practices suggest that we use the same name of the component, ...

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.