title: calling selectRow on ng-grid in a jasmine unit test
body: <p>I have an jasmine test of an angular controller using ng-grid. I want to call <code>selectRow(1, true);</code> on the angular grid, but when I do I get the error <code>TypeError: Object #&lt;Object&gt; has no method 'selectRow'</code></p>
  
  <p>I have a angular controller which sets up an ng-grid like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>    $scope.myGridOptions = {
              data : 'myData',
              multiSelect: false,
              selectedItems: $scope.mySelectedRow,
              afterSelectionChange: function(data) {;
                  if($scope.mySelectedRow === undefined){
                      //do somthing
                  }else{
                      //do somthing else
                  }
              }
          };
  </code></pre>
  
  <p>I then have an jasmine unit test where I instantiate my controller using the inject function, setting the <code>scope</code> object to equal the controllers <code>$scope</code>. I then have a bunch of tests that don't involve the grid, and they all run and pass fine.</p>
  
  <p>However I want to test the select handler logic so I am testing it like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>    it('selecting a row in the table does stuff.', function() {
        //controller created in before each
                rootScope.$digest();//needed to get the controller to initialize
        scope.myGridOptions.$selectRow(1, true);
        expect(scope.resultOfDoingSomthing).toBe("done");
    });
  </code></pre>
  
  <p>Let me know in the comments if more code examples are needed. For background I am using <code>maven jasime:bdd</code> to run the tests, so my jasmine configuration is setup by that. I don't think there are any problems with it as I have quite a few other angular-jasmine unit tests that are all working as expected. The ng-grid javascript is included. I have also tried adding <code>module("ngGrid")</code> to the <code>beforeEach</code> with no change. I also tried adding <code>beforeEach(module("myMod",['ng-grid']));</code> But this blew up with an <code>$injector</code> error.</p>