Private/Angular/Setup/Edit-AngularAddAgGrid.ps1

1
2
3
4
5
6
7
8
9
10
11
12
<#
 # Import ag-grid module and add correct import statements and CSS entries
 #>

Function New-NgServerGridComponent([WebCsprojInfo]$webCsprojInfo)
{
    Install-NodeModule $webCsprojInfo "ag-grid" "AgGridModule" "ag-grid-angular/main" "AgGridModule.withComponents([])"
    Install-NodeModule $webCsprojInfo "ag-grid-angular" 

    Edit-String -File "$($webCsprojInfo.angularDir)/src/styles.css" -Match "." -LastRowRepeats -UnlessAlreadyMatches "ag-grid.css" `
        -Append "@import '../node_modules/ag-grid/dist/styles/ag-grid.css';","@import '../node_modules/ag-grid/dist/styles/theme-fresh.css';"

}