Building a CRUD Application with Angular & ASP.Net Core - Services in Angular GET

Generating our Service with the CLI


Generating our Service with the CLI

In this video we created our first service using the CLI. We used the following commad to generate our camp service.

ng g s camp 
  • ng specifies we are using the Angular CLI
  • g is short for generate because we want to create something
  • s is short for service
  • camp is the name of the service that we wanted to generate

Remember our services should have the @Injectable tag at the top. This is what tells Angular that this should be injectable into our components.

Your Turn Instructions

  1. Create a service that matches the domain for your project using the CLI
    • You can leave the service blank for now