angular generate service in folder code example Example 1: ng cli generate component ng g c componentName Example 2: ng g ng g directive <name> [options]