title: Can Angular-UI-Grid-Edit be used with "controller as" syntax?
body: <p>I've written my entire Angular app managing to avoid the use of $scope, using the "controller as" syntax instead, to help ease the transition to Angular 2.0 and because I believe this is the more current practice.</p>
  
  <p>But I can't figure out how to avoid using $scope with ui-grid's gridApi.edit.on.afterCellEdit event, which is documented as follows:</p>
  
  <pre><code>gridApi.edit.on.afterCellEdit(scope,function(rowEntity, colDef){})
  
  Parameters
  
  rowEntity – {object} – the options.data element that was edited
  colDef – {object} – the column that was edited
  newValue – {object} – new value
  oldValue – {object} – old value
  </code></pre>
  
  <p>Based on the documentation I have done this, which works (after injecting $scope into the controller):</p>
  
  <pre><code>ctrl.tableOptions.onRegisterApi = function(gridApi){
    ctrl.gridApi = gridApi;
    gridApi.edit.on.afterCellEdit( $scope, function(rowEntity,colDef, newValue, oldValue) {
      //save stuff here 
    });
  };
  </code></pre>
  
  <p>but as you can see I had to use $scope in the event's callback, otherwise I get an error telling me scope.$on is not a function. Is it possible to NOT use $scope? I tried "this" but it only seems to want $scope.</p>
  
  <p>Obviously, I don't really understand what I am doing, and I can't find much documentation on afterCellEdit other than <a href="http://ui-grid.info/docs/#/api/ui.grid.edit.api:PublicApi">this</a> and the example which I slavishly followed above, so I am turning to you for help.  Thousands of lines of $scope-free code, it seems like a shame to fall at the last hurdle!</p>
  
  <p>thanks in advance</p>
  
  <p>John </p>