Private/Angular/Component/List/Table/New-NgTableComponent.ps1
<############################################################################ ############################################################################> Function New-NgTableComponent([WebCsprojInfo]$webCsprojInfo, [TableInfo]$tableInfo) { [string]$angularListComponentTsFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-list.component.ts" [string]$newUrl = "/$($tableInfo.tableLowerKebab)-new" Write-Output "### Add component $($tableInfo.tableLowerKebab)ListComponent TypeScript to $angularListComponentTsFileName" New-NgTableComponentTsToString $tableInfo "/$($tableInfo.tableLowerKebab)" $newUrl | Out-FileUtf8NoBom $angularListComponentTsFileName [string]$angularListComponentHtmlFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-list.component.html" Write-Output "### Add component $($tableInfo.tableLowerKebab)Component HTML to $angularListComponentHtmlFileName" New-NgTableComponentHtmlToString $webCsprojInfo $tableInfo | Out-FileUtf8NoBom $angularListComponentHtmlFileName [string]$angularListComponentCssFileName = "$($webCsprojInfo.angularComponentDir)\$($tableInfo.tableLowerKebab)-list.component.css" Write-Output "### Add component $($tableInfo.tableLowerKebab)Component Css to $angularListComponentCssFileName" New-NgTableComponentCssToString $webCsprojInfo $tableInfo | Out-FileUtf8NoBom $angularListComponentCssFileName # 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)" } |