Private/Angular/Component/List/ClientGrid/New-NgClientGridComponent.ps1
<############################################################################ ############################################################################> Function New-NgClientGridComponent([WebCsprojInfo]$webCsprojInfo, [TableInfo]$tableInfo) { Install-NodeModule $webCsprojInfo "ag-grid" "AgGridModule" "ag-grid-angular/main" "AgGridModule.withComponents([])" Install-NodeModule $webCsprojInfo "ag-grid-angular" [string]$angularGridComponentTsFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-grid.component.ts" [string]$newUrl = "/$($tableInfo.tableLowerKebab)-new" Write-Output "### Add component $($tableInfo.tableLowerKebab)GridComponent TypeScript to $angularGridComponentTsFileName" New-NgClientGridComponentTsToString $tableInfo | Out-FileUtf8NoBom $angularGridComponentTsFileName [string]$angularGridComponentHtmlFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-grid.component.html" Write-Output "### Add component $($tableInfo.tableLowerKebab)Component HTML to $angularGridComponentHtmlFileName" New-NgClientGridComponentHtmlToString $webCsprojInfo $tableInfo | Out-FileUtf8NoBom $angularGridComponentHtmlFileName [string]$angularGridComponentCssFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-grid.component.css" Write-Output "### Add component $($tableInfo.tableLowerKebab)Component Css to $angularGridComponentCssFileName" New-NgClientGridComponentCssToString | Out-FileUtf8NoBom $angularGridComponentCssFileName # Add import to app.module Write-Output "### Add component $($tableInfo.tableCapitalCamel)GridComponent to app.module.ts" Edit-NgModuleAddComponent $webCsprojInfo "$($tableInfo.tableCapitalCamel)GridComponent" "./component/$($tableInfo.tableLowerKebab)-grid.component" # Add route Write-Output "### Add route for list component $($tableInfo.tableCapitalCamel)GridComponent to app-routing.module.ts" Edit-NgModuleAddRoute $webCsprojInfo "$($tableInfo.tableCapitalCamel)GridComponent" "./component/$($tableInfo.tableLowerKebab)-grid.component" "$($tableInfo.tableLowerKebab)-grid" } |