Explain why we toggle body's display manually instead of using ngCloak

This commit is contained in:
Juan Cruz Viotti 2016-01-19 10:14:37 -04:00
parent ffbccc5aec
commit 817a6f591b
2 changed files with 16 additions and 2 deletions

View File

@ -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 <body>
// 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() {

View File

@ -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 <body>
// 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() {