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