function $$RAFProvider(){ //rAF
  this.$get = ['$window', '$timeout', function($window, $timeout) {
    var requestAnimationFrame = $window.requestAnimationFrame ||
                                $window.webkitRequestAnimationFrame ||
                                $window.mozRequestAnimationFrame;

    var cancelAnimationFrame = $window.cancelAnimationFrame ||
                               $window.webkitCancelAnimationFrame ||
                               $window.mozCancelAnimationFrame ||
                               $window.webkitCancelRequestAnimationFrame;

    var rafSupported = !!requestAnimationFrame;
    var raf = rafSupported
      ? function(fn) {
          var id = requestAnimationFrame(fn);
          return function() {
            cancelAnimationFrame(id);
          };
        }
      : function(fn) {
          var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666
          return function() {
            $timeout.cancel(timer);
          };
        };

    raf.supported = rafSupported;

    return raf;
  }];
}
@ngdoc method
@name $q#all
@function

@description
Combines multiple promises into a single promise that is resolved when all of the input
promises are resolved.

@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} Returns a single promise that will be resolved with an array/hash of values,
  each value corresponding to the promise at the same index/key in the `promises` array/hash.
  If any of the promises is resolved with a rejection, this resulting promise will be rejected
  with the same rejection value.