function $DeferProvider(){
  this.$get = ['$rootScope', '$browser', function($rootScope, $browser) {
    function defer(fn, delay) {
      return $browser.defer(function() {
        $rootScope.$apply(fn);
      }, delay);
    }

    defer.cancel = function(deferId) {
      return $browser.defer.cancel(deferId);
    };

    return defer;
  }];
}
@ngdoc function
@name angular.module.ng.$defer#cancel
@methodOf angular.module.ng.$defer

@description
Cancels a defered task identified with `deferId`.

@param {*} deferId Token returned by the `$defer` function.
@returns {boolean} Returns `true` if the task hasn't executed yet and was successfuly canceled.