Adding the Component files

Let's start with adding a new /ClientApp/app/components/quiz/quiz.component.ts file with the following content:

import { Component, Input } from "@angular/core";@Component({    selector: "quiz",    templateUrl: './quiz.component.html',    styleUrls: ['./quiz.component.css']})export class QuizComponent {    @Input() quiz: Quiz;}

Once done, follow up with the /ClientApp/app/components/quiz/quiz.component.html template file:

<div *ngIf="quiz" class="quiz">    <h2>{{quiz.Title}}</h2>    <ul>        <li>            <label>Title:</label>            <input [(ngModel)]="quiz.Title" placeholder="Insert the             title..." />        </li>        <li>            <label>Description:</label>            <textarea [(ngModel)]=" quiz.Description"             placeholder="Insert a suitable description..."></textarea>        </li> </ul> ...

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.