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

Function $QProvider

test/angular/1.7/angular.js:17816–17845  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

17814 * @description
17815 */
17816function $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 */
17848function $$QProvider() {

Callers

nothing calls this directly

Calls 2

qFactoryFunction · 0.70
isDefinedFunction · 0.70

Tested by

no test coverage detected