When generating a service using Angular CLI (ng g s my-service
) it by default provides it in root:
@Injectable({
providedIn: 'root'
})
export class MyService {
...
Is there an way to change the setting of the CLI to generate the service without that?
@Injectable()
export class MyServiceService {
...
EDIT
I know I can define a module to provide it with a --module
flag, I'm asking if:
(1) It is possible not to provide the service at all.
(2) Change the default behavior of the CLI - so it doesn't provide by default, or provide in a module by default (without using the module
flag) (It behaved differently in earlier versions)