Ag-grid is JavaScript grid that is widely used in web applications. Ag-grid is used in JavaScript as well as in Angular 2. We can use different grid features like sorting, filtration, section and many more in ag-grid.

Implementing ag-grid in Angular 2

For using ag-grid in Angular application follow the following steps.

[gridOptions] will use settings of GridOptions that is defined in component.

[columnDefs] is bind to columnDefs variable in AppComponent [rowData] is bind to rowData variable in AppComponent

Now save all the files.

Run following command.

Npm install ( It will install all required packages for ag-grid and angular)

After successful installation of packages run thefollowing command.

Npm start

This command will open the results in browser. A simple grid of two columns will be shown in browser.

Angular

You can use different features of ag-grid by exploring the documentation of ag-grid.