From 817a6f591b64635cbb46f086cf9c0ea1d50c16b5 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 19 Jan 2016 10:14:37 -0400 Subject: [PATCH] Explain why we toggle body's display manually instead of using ngCloak --- build/browser/app.js | 9 ++++++++- lib/browser/app.js | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build/browser/app.js b/build/browser/app.js index 806df0db..3a99d405 100644 --- a/build/browser/app.js +++ b/build/browser/app.js @@ -78,7 +78,14 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState this.restart(); - // We're ready to unhide the application now + // We manually add `style="display: none;"` to + // and unset it here instead of using ngCloak since + // the latter takes effect as soon as the Angular + // library was loaded, but doesn't always mean that + // the application is ready, causing the application + // to be shown in an unitialized state for some milliseconds. + // Here in the controller, we are sure things are + // completely up and running. document.querySelector('body').style.display = 'initial'; this.selectImage = function() { diff --git a/lib/browser/app.js b/lib/browser/app.js index d0450ef6..c192104c 100644 --- a/lib/browser/app.js +++ b/lib/browser/app.js @@ -77,7 +77,14 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState this.restart(); - // We're ready to unhide the application now + // We manually add `style="display: none;"` to + // and unset it here instead of using ngCloak since + // the latter takes effect as soon as the Angular + // library was loaded, but doesn't always mean that + // the application is ready, causing the application + // to be shown in an unitialized state for some milliseconds. + // Here in the controller, we are sure things are + // completely up and running. document.querySelector('body').style.display = 'initial'; this.selectImage = function() {