offset offset - 1 year ago 140
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download