Angular Components
If you are using the Angular component version of the grid, it is then possible to customise the internals of the grid with Angular components. For example you can use a component to customise the contents of a cell.
In order for ag-Grid to be able to use your Angular components, you need to provide them in the top level module:
You can then use these components as editors, renderers or filters. For example, to use an Angular Component as a Cell Renderer, you would do the following:
Please see the relevant sections on cell renderers, cell editors and filters for configuring and using Angular components in ag-Grid.
The example has ag-Grid configured through the template in the following ways:
The above is all you need to get started using ag-Grid in a Angular application. Now would be a good time to try it in a simple app and get some data displaying and practice with some of the grid settings before moving onto the advanced features of cellRendering and custom filtering.
Child to Parent Communication
There are a variety of ways to manage component communication in Angular (shared service, local variables
etc),
but you
often need a simple way to let a "parent" component know that something has happened on a "child"
component. In
this case
the simplest route is to use the gridOptions.context to hold a reference to the parent,
which the
child can then access.
Note that although we've used componentParent as the property name here it can be anything -
the main point is that you can use the context mechanism to share information between the components.
The "A Simple Example, using CellRenderers created from Angular Components" above illustrates this in the Child/Parent column: