Private/Angular/Component/List/ServerGrid/New-NgServerGridComponent.ps1
<############################################################################ ############################################################################> Function New-NgServerGridComponent([WebCsprojInfo]$webCsprojInfo, [TableInfo]$tableInfo) { Add-AgGrid $webCsprojInfo [string]$angularGridComponentTsFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-list.component.ts" [string]$newUrl = "/$($tableInfo.tableLowerKebab)-new" Write-Output "### Add component $($tableInfo.tableLowerKebab)ListComponent TypeScript to $angularGridComponentTsFileName" New-NgServerGridComponentTsToString $tableInfo | Out-FileUtf8NoBom $angularGridComponentTsFileName [string]$angularGridComponentHtmlFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-list.component.html" Write-Output "### Add component $($tableInfo.tableLowerKebab)Component HTML to $angularGridComponentHtmlFileName" New-NgServerGridComponentHtmlToString $webCsprojInfo $tableInfo | Out-FileUtf8NoBom $angularGridComponentHtmlFileName [string]$angularGridComponentCssFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-list.component.css" Write-Output "### Add component $($tableInfo.tableLowerKebab)Component Css to $angularGridComponentCssFileName" New-NgServerGridComponentCssToString | Out-FileUtf8NoBom $angularGridComponentCssFileName # Add import to app.module Write-Output "### Add component $($tableInfo.tableCapitalCamel)ListComponent to app.module.ts" Edit-NgModuleAddComponent $webCsprojInfo "$($tableInfo.tableCapitalCamel)ListComponent" "./component/$($tableInfo.tableLowerKebab)-list.component" # Add route Write-Output "### Add route for list component $($tableInfo.tableCapitalCamel)ListComponent to app-routing.module.ts" Edit-NgModuleAddRoute $webCsprojInfo "$($tableInfo.tableCapitalCamel)ListComponent" "./component/$($tableInfo.tableLowerKebab)-list.component" "$($tableInfo.tableLowerKebab)-list" } |