Prevent double curly brace notation from displaying momentarily before angular.js compiles/interpolates document

It seems to be primarily an issue in IE when there is a number of images/scripts to load, there can be a good amount of time where the literal {{stringExpression}} in the markup are displayed, then disappear once angular is done with it's compilation/interpolation of the document.

Is there a common reason why this would happen which would indicate I'm doing something generally wrong, or is there a known way to prevent this?

I think that you are looking for the ngCloak directive: http://docs.angularjs.org/api/ng.directive:ngCloak

From the documentation:

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 typically a fine-grained application is prefered in order to benefit from progressive rendering of the browser view.

Also, you can use <span ng-bind="hello"></span> instead of {{hello}}.

http://jsfiddle.net/4LhN9/34/

To improve the effectiveness of class='ng-cloak' approach when scripts are loaded last, make sure the following css is loaded in the head of the document:

.ng-cloak { display:none; }

Just add the cloaking CSS to the head of the page or to one of your CSS files:

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

Then you can use the ngCloak directive according to normal Angular practice, and it will work even before Angular itself is loaded.

This is exactly what Angular does: the code at the end of angular.js adds the above CSS rules to the head of the page.

In your css add folllowing

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

And then in you code you can add ng-cloak directive. For example,

<div ng-cloak>
   Welcome {{data.name}}
</div>

Thats it!

code1: {{ var='hidden text'; ''; }} output1:

code2: {{ var='visible text'; }} output2: visible text

the trick is to put ;'' after expression.

{{ variable-to-hide ; '' }}

-

EDIT : angular only outputs the last line that comes after ; semicolon.

{{
   var1='hello' ;   // output is hidden 
   var2= 'my' ;     // output is hidden 
   var3='friend'    // last one is shown
}}

output: friend

if i exploit the only show last line rule

{{
   var1='hello' ; //hidden
   var2= 'my' ;   //hidden
   var3='friend';  // hidden
   var3=''         // last one is shown which is empty string `''`
}}

output: " " //we see an empty string