Event handlers versus router links

It's worth nothing that instead of adding an <input> element and binding its click action to a event-handler delegate method like we just did, we could've done the following:

<a [routerLink]="['/quiz/edit', quiz.Id]"

This is the same approach taken by the NavMenuComponent with the menu entries: just a plain anchor ID QueryString parameter. Both approaches will get the job done, hence we're free to use whatever we like the most.

A big advantage of the anchor/routerLink method is that everything happens on the template, arguably making it easier and faster to lay it down; conversely, the input/click method is more versatile, as the delegate method enables the developer to do virtually anything, as we'll get to see in the next paragraph.
..................Content has been hidden....................

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