Swader
Swader

Reputation: 11597

What is the proper way to prevent bindings and directives from being visible for the split second before angular is loaded?

When my app loads, angular directives and bindings are visible for a slight moment before Angular consumes them. This is distracting and looks unprofessional, and I fear it may leave an unpleasant mark on my visitors.

What is the proper way to avoid this, besides the obvious solution of putting the Angular loading script into the head and blocking the render of the rest of the page?

Upvotes: 1

Views: 68

Answers (3)

sparkalow
sparkalow

Reputation: 176

http://docs.angularjs.org/api/ng.directive:ngCloak

Try the ng-cloak directive. Docs state is just for this situation. I've used it without loading angular in the head as well.

Upvotes: 1

Roy Daniels
Roy Daniels

Reputation: 6309

You should use either ngBind or ngCloak.

See ngBind API / ngCloak API

Upvotes: 3

Ajay Singh Beniwal
Ajay Singh Beniwal

Reputation: 19037

Please use ngCloak directive

http://docs.angularjs.org/api/ng.directive:ngCloak

Upvotes: 1

Related Questions