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

Function $QProvider

lib/test/angular/1.6.7/angular.js:17013–17042  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

17011 * @description
17012 */
17013function $QProvider() {
17014 var errorOnUnhandledRejections = true;
17015 this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
17016 return qFactory(function(callback) {
17017 $rootScope.$evalAsync(callback);
17018 }, $exceptionHandler, errorOnUnhandledRejections);
17019 }];
17020
17021 /**
17022 * @ngdoc method
17023 * @name $qProvider#errorOnUnhandledRejections
17024 * @kind function
17025 *
17026 * @description
17027 * Retrieves or overrides whether to generate an error when a rejected promise is not handled.
17028 * This feature is enabled by default.
17029 *
17030 * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
17031 * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for
17032 * chaining otherwise.
17033 */
17034 this.errorOnUnhandledRejections = function(value) {
17035 if (isDefined(value)) {
17036 errorOnUnhandledRejections = value;
17037 return this;
17038 } else {
17039 return errorOnUnhandledRejections;
17040 }
17041 };
17042}
17043
17044/** @this */
17045function $$QProvider() {

Callers

nothing calls this directly

Calls 2

qFactoryFunction · 0.70
isDefinedFunction · 0.70

Tested by

no test coverage detected