Search⌘ K

Create Event Update Component

Explore how to create an event update component in Angular using the CLI and routing setup. Learn to restrict access to event creators only and update component tests to cover new functionality. Understand how to integrate authorization guards and dynamic routing.

Now that the update method of EventsService is ready, we can add the last component to EventModule.

Setup and routing

First, we’ll create our component, adding it to the existing event directory.

ng g component event/event-update
Terminal 1
Terminal
Loading...

With this command, the CLI created our new component in src/app/event. It also added the component to the declarations in EventModule.

CREATE src/app/event/event-update/event-update.component.css
CREATE src/app/event/event-update/event-update.component.html
CREATE src/app/event/event-update/event-update.component.spec.ts
CREATE src/app/event/event-update/event-update.component.ts
UPDATE
...