offset offset - 1 month ago 22
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

To stop rendering till the data arrives do something like

<div ng-if="contentAvailable">
   <ng-grid/>
</div>

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

Comments