Updating QuizEditComponent

The QuizEditComponent features a very simple yet perfectly working form, hence it's perfect to become our guinea pig.

Open the quiz-edit.component.ts file and update it in the following way (new lines are highlighted):

import { Component, Inject, OnInit } from "@angular/core";import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms';[...]export class QuizEditComponent {    title: string;    quiz: Quiz;    form: FormGroup;[...]    constructor(private activatedRoute: ActivatedRoute,        private router: Router,        private http: HttpClient,        private fb: FormBuilder,        @Inject('BASE_URL') private baseUrl: string) {        // create an empty object from the Quiz interface        this.quiz = <Quiz>{};        // initialize the form this.createForm(); ...

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.