From 46119dec6fb096d31558e3e2051a08743f504b9a Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Thu, 30 Nov 2017 09:08:18 +0200 Subject: [PATCH] UI must be created before first render, drainMicroTasks when the first page is created --- nativescript-angular/platform-common.ts | 6 ++++-- nativescript-angular/zone-js/dist/zone-nativescript.js | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nativescript-angular/platform-common.ts b/nativescript-angular/platform-common.ts index 19bd05efc..a5679a0b4 100644 --- a/nativescript-angular/platform-common.ts +++ b/nativescript-angular/platform-common.ts @@ -207,16 +207,18 @@ export class NativeScriptPlatformRef extends PlatformRef { reject(err); } }); + + (global).Zone.drainMicroTaskQueue(); }); page.on(Page.navigatingToEvent, initHandler); return page; - } + }, + animated: false }; if (isReboot) { - navEntry.animated = false; navEntry.clearHistory = true; } diff --git a/nativescript-angular/zone-js/dist/zone-nativescript.js b/nativescript-angular/zone-js/dist/zone-nativescript.js index e7df007cb..38616df9f 100644 --- a/nativescript-angular/zone-js/dist/zone-nativescript.js +++ b/nativescript-angular/zone-js/dist/zone-nativescript.js @@ -616,6 +616,7 @@ var Zone$1 = (function (global) { _isDrainingMicrotaskQueue = false; } } + Zone.drainMicroTaskQueue = drainMicroTaskQueue; function isThenable(value) { return value && value.then; } @@ -1576,6 +1577,7 @@ function patchEventTargetMethods(obj, addFnName, removeFnName, metaCreator) { return false; } } +var originalInstanceKey = zoneSymbol('originalInstance'); // wrap some native API on `window`