Upgrading the QuizComponent

Now we need to perform some important changes to the quiz.component.ts file to ensure that our QuizComponent will properly receive and handle it.

Since we’re removing the parent property binding, we can safely remove the reference to the Input interface module, as well as the @Input decorator, from our local quiz variable, as we’re not using them here anymore.

It's important to understand that as soon as we do this, the binding relationship between the QuizListComponent and QuizComponent will cease to work. However, this is hardly an issue; although it has been being very useful to demonstrate how two-way binding works, the time has come to replace it with a more reasonable, route-based navigation mechanism.
[...]

export class QuizComponent {
quiz: Quiz;
}

[...]

We still need to retrieve the quiz data through the server-side API, however to do that, we will need the quiz ID that is expected to come as a GET parameter through the routed HTTP request.

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

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