MCPcopy Index your code
hub / github.com/angular-ui/ui-router / $QProvider

Function $QProvider

test/angular/1.6/angular.js:17198–17227  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

17196 * @description
17197 */
17198function $QProvider() {
17199 var errorOnUnhandledRejections = true;
17200 this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
17201 return qFactory(function(callback) {
17202 $rootScope.$evalAsync(callback);
17203 }, $exceptionHandler, errorOnUnhandledRejections);
17204 }];
17205
17206 /**
17207 * @ngdoc method
17208 * @name $qProvider#errorOnUnhandledRejections
17209 * @kind function
17210 *
17211 * @description
17212 * Retrieves or overrides whether to generate an error when a rejected promise is not handled.
17213 * This feature is enabled by default.
17214 *
17215 * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
17216 * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for
17217 * chaining otherwise.
17218 */
17219 this.errorOnUnhandledRejections = function(value) {
17220 if (isDefined(value)) {
17221 errorOnUnhandledRejections = value;
17222 return this;
17223 } else {
17224 return errorOnUnhandledRejections;
17225 }
17226 };
17227}
17228
17229/** @this */
17230function $$QProvider() {

Callers

nothing calls this directly

Calls 2

qFactoryFunction · 0.70
isDefinedFunction · 0.70

Tested by

no test coverage detected