Create Event Service

Let's now add a service for creating events and write tests for this service.

Now that the interceptor has been created, we can move on to adding an event-creating service for creating events. First, generate the service.

ng g service services/events/events

Then create a model for events.

ng g interface services/events/event
Terminal 1
Terminal
Loading...

The first command ng g service services/events/event creates two files. Below is the expected terminal output.

CREATE src/app/services/events/events.service.spec.ts
CREATE src/app/services/events/events.service.ts

The second command ng g interface services/events/event creates one file. Below is the expected terminal output. ...