4

I am using ag-grid for dataTables. I have created a component which consists of ag-grid. A unique ID is passed as input to this component and I want to give this id as grid id.

<ag-grid-ng2 #agGrid class="ag-fresh" [gridOptions]="gridOptions" [columnDefs]="columnDefs"
[rowData]="rowData">

So i want to make this id #agGrid to be dynamic.

How can I achieve this ?

Kim Kern
  • 54,283
  • 17
  • 197
  • 195
ashfaq.p
  • 5,379
  • 21
  • 35

1 Answers1

1

You should be able to do use any of the following to set a unique id:

  • [id]="dynamicId"
  • [attr.id]="dynamicId"
  • id={{item.dynamicId}}
jgood044
  • 36
  • 2