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

This reverts commit 7e3f9a482a.
This commit is contained in:
Chuck Jazdzewski
2018-01-17 15:28:21 -08:00
parent 0eabd07f3a
commit 47b7898697
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;