Revert "fix(core): fix chained http call (#20924)"

This reverts commit 54e75766ad.
This commit is contained in:
Miško Hevery
2018-01-19 13:06:33 -08:00
parent af4eb00c91
commit 0d55600fd8
2 changed files with 37 additions and 44 deletions

View File

@ -98,22 +98,13 @@ export class Testability implements PublicTestability {
/** @internal */
_runCallbacksIfReady(): void {
if (this.isStable()) {
if (this._callbacks.length !== 0) {
// Schedules the call backs after a macro task run outside of the angular zone to make sure
// no new task are added
this._ngZone.runOutsideAngular(() => {
setTimeout(() => {
if (this.isStable()) {
while (this._callbacks.length !== 0) {
(this._callbacks.pop() !)(this._didWork);
}
this._didWork = false;
}
});
});
} else {
// Schedules the call backs in a new frame so that it is always async.
scheduleMicroTask(() => {
while (this._callbacks.length !== 0) {
(this._callbacks.pop() !)(this._didWork);
}
this._didWork = false;
}
});
} else {
// Not Ready
this._didWork = true;