* @ngdoc provider * @name $qProvider * @this * * @description
()
| 17814 | * @description |
| 17815 | */ |
| 17816 | function $QProvider() { |
| 17817 | var errorOnUnhandledRejections = true; |
| 17818 | this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { |
| 17819 | return qFactory(function(callback) { |
| 17820 | $rootScope.$evalAsync(callback); |
| 17821 | }, $exceptionHandler, errorOnUnhandledRejections); |
| 17822 | }]; |
| 17823 | |
| 17824 | /** |
| 17825 | * @ngdoc method |
| 17826 | * @name $qProvider#errorOnUnhandledRejections |
| 17827 | * @kind function |
| 17828 | * |
| 17829 | * @description |
| 17830 | * Retrieves or overrides whether to generate an error when a rejected promise is not handled. |
| 17831 | * This feature is enabled by default. |
| 17832 | * |
| 17833 | * @param {boolean=} value Whether to generate an error when a rejected promise is not handled. |
| 17834 | * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for |
| 17835 | * chaining otherwise. |
| 17836 | */ |
| 17837 | this.errorOnUnhandledRejections = function(value) { |
| 17838 | if (isDefined(value)) { |
| 17839 | errorOnUnhandledRejections = value; |
| 17840 | return this; |
| 17841 | } else { |
| 17842 | return errorOnUnhandledRejections; |
| 17843 | } |
| 17844 | }; |
| 17845 | } |
| 17846 | |
| 17847 | /** @this */ |
| 17848 | function $$QProvider() { |