MCPcopy
hub / github.com/angular-ui/ui-grid / $QProvider

Function $QProvider

lib/test/angular/1.7.0/angular.js:17242–17271  ·  view source on GitHub ↗

* @ngdoc provider * @name $qProvider * @this * * @description

()

Source from the content-addressed store, hash-verified

17240 * @description
17241 */
17242function $QProvider() {
17243 var errorOnUnhandledRejections = true;
17244 this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
17245 return qFactory(function(callback) {
17246 $rootScope.$evalAsync(callback);
17247 }, $exceptionHandler, errorOnUnhandledRejections);
17248 }];
17249
17250 /**
17251 * @ngdoc method
17252 * @name $qProvider#errorOnUnhandledRejections
17253 * @kind function
17254 *
17255 * @description
17256 * Retrieves or overrides whether to generate an error when a rejected promise is not handled.
17257 * This feature is enabled by default.
17258 *
17259 * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
17260 * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for
17261 * chaining otherwise.
17262 */
17263 this.errorOnUnhandledRejections = function(value) {
17264 if (isDefined(value)) {
17265 errorOnUnhandledRejections = value;
17266 return this;
17267 } else {
17268 return errorOnUnhandledRejections;
17269 }
17270 };
17271}
17272
17273/** @this */
17274function $$QProvider() {

Callers

nothing calls this directly

Calls 2

qFactoryFunction · 0.70
isDefinedFunction · 0.70

Tested by

no test coverage detected