Angular 9 References/ CLI

Interceptor generator

This is the documentation for Angular 9.
You can switch to the latest version Angular 10.
ng generate interceptor <name> [--[option]=[value]]

Creates a new, generic interceptor definition in the given or default project.



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


When true, applies lint fixes after generating the interceptor.
Type boolean
Default false


The name of the project.
Type string


When true, does not create `spec.ts` test files for the new interceptor.
Type boolean
Default false