Private/Angular/Service/New-NgCrudServiceTsToString.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Function New-NgCrudServiceTsToString($entity, $verbList) {
$entityCapital = (ConvertTo-CapitalCamelCase $entity)
$entityLowerCamel = (ConvertTo-LowerCamelCase $entity)
$entityLowerKebab = (ConvertTo-KebabCase $entity)

return @"
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { GenericCrudService } from 'box-turtle-ng';
import { $entityCapital } from '../model/$entityCapital';

@Injectable()
export class $($entityCapital)Service extends GenericCrudService<$($entityCapital)> {

    constructor(http: Http) {
        super(http, '/api/$($entityLowerCamel)', [$verbList]);
    }

}
"@
;
}