Private/Angular/Setup/Add-AgGrid.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<############################################################################
 # Add ag-grid support to an angular project
 ############################################################################>

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

    # Add ag-grid styles
    Edit-String -File $webCsprojInfo.stylesCss -Append `
        "@import '../node_modules/ag-grid/dist/styles/ag-grid.css';","@import '../node_modules/ag-grid/dist/styles/theme-fresh.css';" `
        -UnlessAlreadyMatches "ag-grid.css"

}