References and routes

We already know that we have to add every component to the app.module.shared.ts file's import list and declarations array, so we won't explain how to do it again; let's just do it as we already did a number of other times.

While we're there, let's add the missing routes as well to the RouterModule, just after the quiz ones:

[...]

{ path: 'quiz/create', component: QuizEditComponent },
{ path: 'quiz/edit/:id', component: QuizEditComponent },
{ path: 'quiz/:id', component: QuizComponent },
{ path: 'question/create/:id', component: QuestionEditComponent },
{ path: 'question/edit/:id', component: QuestionEditComponent },
{ path: 'about', component: AboutComponent },

[...]

We can easily note a big difference between the quiz/create and the question/create/:id routes--the latter will require an :id parameter, just like the question/edit/:id counterpart. We already explained the reason earlier, but it can't hurt to repeat it here--the Create mode will need to know the QuizId when issuing the Put Http call to the QuestionController, as it's a required property of the Question Entity.

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

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