Ag-grid: Angular dynamic loading data (without async)

For anyone not using "async" in their html, its importance to set your variable to a type but not an array.
The difference is small but there is almost no reference to it in the documentation. I found this out while working on my own complex UI grid. In fact very proud of the results, but would like to have the same responsiveness that datatables provides. I'll have an article more on that later. For now this is just a small tip for anyone looking to not use "async" which is in the documentations. I think the benefits of doing this this way is less html to maintain as well as simpler code.

rowData: []; //You can't use array methods until you have data, which you really shouldn't be anyway.
rowData = []; //this allow you to reference array methods at the start or when there is data but does not allow ag-grid to be aware that the rowData is empty. You can still update the array but when you do it just shows an message that your rowData is empty first which I don't like for UX. 


Popular posts from this blog

Nginx Best Practices Extended

Installing Windows on Acer chromebook 15 cb3-532

Entity Framework: ToListAynsc & WhereAsync