QuestionListComponent

The first thing we'll do is to implement a QuestionListComponent that will show a list of questions for any given quiz; once done, we'll add it to our already-existing QuizEditComponent, thus enabling our users to view, create, edit, and/or delete them from the same place where they can edit the details of the parent quiz.

Start with creating the /ClientApp/app/components/question/ folder, then right-click on it and add the question-list.component.ts file with the following content (relevant lines are highlighted):

import { Component, Inject, Input, OnChanges, SimpleChanges } from "@angular/core";import { Router } from "@angular/router";import { HttpClient } from "@angular/common/http";@Component({ selector: "question-list", ...

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.