ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

Calling reload() before rendering the directive produces error

Open okonomiyaki3000 opened this issue 12 years ago • 1 comments

Let's say I create an ngTableParams object in my controller with the intention of passing it to the ng-table directive in the view. Now let's say that, before that happens (still in the controller) I happen to call reload() on the object. This will produce an error because the local $scope used inside the reload function doesn't exist yet.

So, maybe I shouldn't be calling reload() when the thing hasn't even been rendered yet but I can, so I might then the error should be avoided if possible.

okonomiyaki3000 avatar Aug 13 '14 03:08 okonomiyaki3000

You can use $scope.$evalAsync or $timeout to wait for table rendering.

maxaon avatar Aug 14 '14 15:08 maxaon