Rodrigo Fonseca
Rodrigo Fonseca

Reputation: 944

Can i use ng-show with display:none?

Here is my plunker, what is happening is that always when i refresh the page, even if the ng-show is "false", it always show something for a milliseconds. I know why this is happening, it happens because angular hasn't been loaded yet, so i want to use a css property "display:none" to avoid this, but it still isn't working...

Upvotes: 1

Views: 409

Answers (2)

Timothée Jeannin
Timothée Jeannin

Reputation: 9912

You may want to take a look at ng-cloak. For example:

<div id="template1" ng-cloak>{{ 'hello' }}</div>

This will prevent the browser from displaying the "#template1" div during the brief time the hello scope model don't have any value.

Upvotes: 1

Jscti
Jscti

Reputation: 14440

Take a look a the ngCloak directive (and its CSS) that is designed specifically for this purpose

Hope this helps

Upvotes: 1

Related Questions