* @ngdoc provider * @name $qProvider * @this * * @description
()
| 17196 | * @description |
| 17197 | */ |
| 17198 | function $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 */ |
| 17230 | function $$QProvider() { |