CLI

generate service

Command
ng generate service
ng generate s

Creates a new, generic service definition in the given project.

Arguments

name

The name of the service.

Value Typestring

Options

flat

When true (the default), creates files at the top level of the project.

Value TypebooleanDefaulttrue
project

The name of the project.

Value Typestring
skip-tests

Do not create "spec.ts" test files for the new service.

Value TypebooleanDefaultfalse
Jump to details