The template file

Let's come back to the QuestionListComponent template file. Once again, we made good use of the *ngIf directive to show a different <div> element depending on if the quiz has at least one question or not; the former contains a table where we iterate through the questions and show them accordingly, while the latter hosts a classic "empty contents" info message that the users will see where the quiz contains no questions (yet).

We also added three input buttons that will fire some delegate methods defined in the QuestionListComponent class: onAdd, onEdit, and onDelete. Their names are quite self-explanatory, hence we already know what to expect from them. Note how the Delete event handler is the only one that performs its task firsthand, while the other two will just route the user away. None of these routes is handled yet, but we'll fix this soon enough.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.249.210