0
votes

I am trying to get my nggrid working in my modal:

  $scope.open = function() {
    $modal.open({
      templateUrl: 'myModalContent.html',
      backdrop: true,
      windowClass: 'modal',
      controller: function($scope, $modalInstance) {
        $scope.submit = function() {
          $modalInstance.dismiss('cancel');
        }
        $scope.cancel = function() {
          $modalInstance.dismiss('cancel');
        };
      }
    });
  };

But getting this error:

TypeError: Cannot set property 'gridDim' of undefined

plunkr ref: https://plnkr.co/edit/2cIJiCdRA2K3nqEW7W56?p=preview

1

1 Answers

0
votes

See my plunker,

https://plnkr.co/edit/T22v7Ma8rwSqiCk5OiMG?p=preview

I believe the mistake you had was you added the data and ng-grid initialisation not within the scope of your $modal, if you look at the plunkr I just moved those scopes inside the controller of your $modal and it worked.