1>>> ng generate service service_name
2or
3>>> ng generate service /folder-name/service-name
1For Creating Service you have type command like below
2ng generate service service-name
3or
4ng g s service-name
5
6And if you want to make service into folder
7ng generate service /folder-name/service-name
8or
9ng g s /folder-name/service-name
1import { <service name>Service } from '../<service path>';
2you can inject service in components constructor:
3constructor(public anyService: Service){}