Activating the Edit mode

We're now able to launch our QuizEditController in Create mode from the Create a Quiz NavMenu link; however, there's currently no way to access the Edit mode yet. The most logical way to do that would probably be from the QuizComponent; the user will navigate from the quiz list(s) to a specific quiz, then--assuming that it's the author--would see a button to access the Quiz Edit view.

To implement such behavior, open the quiz.component.html template file and add the following code (new lines are highlighted):

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

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.