Furthermore, it encompasses specific details as long as the QProvider
is defined in the following manner:
function $QProvider() {
this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
return qFactory(function(callback) {
$rootScope.$evalAsync(callback); // ! $evalAsync()
}, $exceptionHandler);
}];
}
Within this function definition, there exists a concise approach to the method .$evalAsync()
for version 1.2.28:
$evalAsync: function(expr) {
// if we are outside of an $digest loop and this is the first time we are scheduling async
// task also schedule async auto-flush
if (!$rootScope.$$phase && !$rootScope.$$asyncQueue.length) {
$browser.defer(function() {
if ($rootScope.$$asyncQueue.length) {
$rootScope.$digest(); // ! $digest()
}
});
}
this.$$asyncQueue.push({scope: this, expression: expr});
},