Questions tagged [ngcloak]

The ngCloak directive is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display.

The directive can be applied to the <body> element, but the preferred usage is to apply multiple ngCloak directives to small portions of the page to permit progressive rendering of the browser view.

ngCloak works in cooperation with the following css rule embedded within angular.js and angular.min.js. For CSP mode please add angular-csp.css to your html file (see ngCsp).

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
  display: none !important;
}

When this css rule is loaded by the browser, all html elements (including their children) that are tagged with the ngCloak directive are hidden. When Angular encounters this directive during the compilation of the template it deletes the ngCloak element attribute, making the compiled element visible.

For the best result, the angular.js script must be loaded in the head section of the html document; alternatively, the css rule above must be included in the external stylesheet of the application

37 questions
1
vote
1 answer

Angularjs - How to make login page load instead of index page when giving weburl

I have created a web app where the user needs to login first. When i type the url in the address bar and press enter, i first see the contents of my index page that is the navigation bar ,interpolation code where i bind data if the user is logged in…
Tony Roczz
  • 2,366
  • 6
  • 32
  • 59
1
vote
1 answer

Disable form/page until APIs that load controls are complete

I have an HTML form that makes use of a select element. The options of the select element are populated via an API call. I am finding that at times the page appears to be done loading but the select element is not yet populated. I am looking for a…
webworm
  • 10,587
  • 33
  • 120
  • 217
1
vote
1 answer

AngularJS shows model text before compilation despite ng-cloak

I'm working on a page that has to run on an embedded android system (in the system webview), and this thing is tragically slow. So slow in fact, that when you load a page, somtimes the model text is still on the page for a good half second before…
Osmium USA
  • 1,751
  • 19
  • 37
1
vote
1 answer

AngularJS - ng-cloak on button not working (flicker still exists) in Chromium - ng-cloak doesn't even get added to the CSS for some reason

This is my HTML (amongst other things): The HTML above is extending this HTML page:
SilentDev
  • 20,997
  • 28
  • 111
  • 214
1
vote
1 answer

AngularJS - Cloak element (after DOM is loaded) when switching between elements

I have a grid setup in my web application. When the user checks a box it switches to a second grid already loaded on the DOM ( a printer friendly version ). There is also a third grid loaded which is populated as the user chooses rows they want to…
notAChance
  • 1,360
  • 4
  • 15
  • 47
1
vote
1 answer

Angular ng-cloak wait child directive template to load

My problem is that when I use ng-cloak in pages that include elements which make use of directives with template code, ng-cloak does not wait for this template code to load and the page is shown incrementally and not as a whole (page elements first…
kasimoglou
  • 384
  • 3
  • 17
0
votes
0 answers

Why is AngularJs not rendeting directive on page change?

I found this treeview directive //////////////////////////////////////////////////////////////////////////////// /// TREEVIEW ////////////////////////////////////////////////////////////////// angular.module('myApp.treeView',…
Atlas91
  • 5,754
  • 17
  • 69
  • 141
0
votes
1 answer

Make a full-screen loading image for an AngularJS website

I want to show a full-screen image before my AngularJS website is fully bootstrapped. One way is to use ng-cloak. This is an example to show a line of words. I tried to make a full-screen image instead [ng-cloak].splash { /* The image used */ …
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
0
votes
1 answer

ng-cloak not working properly

In my angular app, I'm displaying a pdf using tag. Oops, you have no…
I'm nidhin
  • 2,592
  • 6
  • 36
  • 62
0
votes
2 answers

How to use ng-cloak in angular js properly?

I have a basic question about ng-cloak In my page I have some places where are I binded some data using angular js {{ }}. Now, I used ng-cloak directive in the body tag and because of this the whole page is going blank for sometime until the page…
Harish
  • 1,193
  • 6
  • 22
  • 45
0
votes
1 answer

adding ng-model to my checkbox flickers the modal in the angular screen

how to avoid flicker of a modal box upon clicking on a chekckbox inside that modal Show I tried ng-cloak, it doesn't help
Jasmine
  • 5,186
  • 16
  • 62
  • 114
0
votes
2 answers

Angular JS - Page flickering without css

In my web application we have a master index.html , which includes header.html,footer.html,preference.html... and main view content . When the page loads,(url = index.html#) I could see the static content of header,footer and then actual page loads…
GKD
  • 53
  • 1
  • 1
  • 7
0
votes
1 answer

AngularJS - DOM-Elements are flickering

lately I have a pretty significant problem with ng-view and ng-if.Suppose there is a dropdown with two elements (element one and element two).The two elements change a property on rootScope. I have two more items at another location (div-container,…
Heddy
  • 1
0
votes
2 answers

Can't get ng-cloak to work

I have a custom directive where I present the values in it using {{}} but the problem is when the page is reloading I get to see {{}} there before setting the values. I tried using ng-cloak but too bad it is not working for me. After googling this I…
user5235479
0
votes
1 answer

AngularJS: Expressions visible when IE unloads

I've run into a problem where refreshing an AngularJS page in IE shows the uncompiled AngularJS. I can use ngCloak to hide the uncompiled expressions when loading, but I can't find anything for when the page unloads. I can use ngBind instead of an…
ricksmt
  • 888
  • 2
  • 13
  • 34