offset offset - 10 months ago 98
AngularJS Question

Angular ng-grid declare gridOptions in function

I'm new at angular, and I try to declare gridOption for ng-grid Within a function, because I want it not fire before the data come from the server.
But if I do so, it cause an error:

TypeError: Cannot set property 'gridDim' of undefined

Please, I need help urgently!!!

Thanks in advance.

Answer Source

To stop rendering till the data arrives do something like

<div ng-if="contentAvailable">

In you controller when the data is available setup the gridoptions object, followed by contentAvailable to true.