title: Angular UI-Grid - Event afterCellEdit not firing when cell value updated by custom directive
body: <p>I develop web application with AngularJS 1.5.0 and UI-Grid 3.1.1.</p>
  
  <p>I need to have column with cross-browser datepicker, so I decided to use Bootstrap-Datepicker (<a href="https://github.com/eternicode/bootstrap-datepicker" rel="nofollow noreferrer">https://github.com/eternicode/bootstrap-datepicker</a>).</p>
  
  <p>For this column I use customTemplate:</p>
  
  <pre><code>rejestrator.columnTemplates.dayCellEditable =
  '&lt;div class="column-day"&gt;' +
      '&lt;span ng-model="row.entity.day" ng-change="updateDayCell(row, row.entity.day)" aa-date-input&gt;{{ COL_FIELD | date:"yyyy-MM-dd" }}&lt;/span&gt;'+
  '&lt;/div&gt;';
  </code></pre>
  
  <p>When I click on day cell, datepicker is invoked correctly, it even updates cell in row with chosen data, but unfortunately no function UpdateDayCell (ng-change) is fired nor even gridApi.edit.on.afterCellEdit...</p>
  
  <p>I need to fire updateDayCell controller's function or fire event to listener on.afterCellEdit to send request to update my database.</p>
  
  <p>My grid definition is:</p>
  
  <pre><code>$scope.myTaskGridOptions = {
      exporterMenuCsv: false,
      enableGridMenu: true,
      enableSorting: true,
      enableFiltering: false,
      enableCellEditOnFocus: true,
      columnDefs: [
          {
              name: 'Dzień', 
              field: 'day', 
              width: '130',
              sort: { direction: 'asc', priority: 0 }, 
              type: 'date',
              cellFilter: 'date:\'yyyy-MM-dd\'',
              cellTemplate: rejestrator.columnTemplates.dayCellEditable, 
              enableCellEdit:false
          },
          {
              name: 'Projekt',
              field: 'project_name', 
              editableCellTemplate: 'ui-grid/dropdownEditor',
              width: '15%', 
              editDropdownOptionsFunction : MyTasksProvider.getMyProjects
          },
          { 
            name: 'Opis',  
            field: 'description', 
            width: '50%' 
            },
          {
              name: 'Czas',      
              field: 'used_time' , 
              width: '75', 
              type: 'string',
              cellTemplate: rejestrator.columnTemplates.timeCell,
              enableCellEdit: false
          },
          {
            name: 'Akcje',
            field: 'id',
            enableSorting: false,  
            width: '90', 
             cellTemplate: rejestrator.columnTemplates.actionsCell,
            displayName: '',
            enableColumnMenu:false, 
            enableCellEdit: false
          }
      ],
      //Bind events
      onRegisterApi : function(gridApi){
          $scope.gridApi = gridApi;
          gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef, newValue, oldValue){
              if (newValue !== oldValue) {
                  var callback = function(){};
                  var fieldToChange = colDef.field,
                      valueToSet = newValue;
                  if (fieldToChange === 'project_name') {
                      fieldToChange = 'project_id';
                      callback = refreshGrid;
                  } else if (fieldToChange == 'day') {
                      valueToSet = $filter('date')(newValue, "yyyy-MM-dd");
                      rowEntity.day = valueToSet;
                  }
                  CommonTasksProvider.updateTaskFieldByID(rowEntity.id, fieldToChange, valueToSet, callback);
              }
          });
          //gridApi.core.on.filterChange
      },
      //Disable multiselection
      multiSelect: true
  };
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uH0HM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uH0HM.jpg" alt="grid"></a></p>
  
  <p>EDIT:</p>
  
  <p>I added  watch for event 'aa:calendar:set-date' fired by Datepicker when value is set:</p>
  
  <pre><code>$scope.$on('aa:calendar:set-date', function(event, toState, toParams, fromState, fromParams){
      var dateObj = event.targetScope.$parent.ngModel,
          day = $filter('date')(dateObj, "yyyy-MM-dd"),
          taskId = event.targetScope.$parent.taskId;
      return CommonTasksProvider.updateTaskFieldByID(taskId, 'day', day)
  });
  </code></pre>
  
  <p><strong>And it works. Guys, do you think it is good solution? Angular-way? Or maybe performance expensive?</strong></p>