Loading...

{{notif_text}}

Why join channels?
Learn from peers
Discuss and share learning resources with the top professionals across the world
Open business or job opportunities
Earn reputation points to get consulting projects, attract talent or land jobs.
Accelerate your growth
Grow your network and get exclusive deals from our learning partners.
signup now
Priyank Agrawal asked a question
{{::getFormatedLocalTime("2017-10-28T13:07:11.407Z", {without_time: true})}}

How to avoid interpolation curly braces from appearing on screen when angularjs is loading

When AngularJs is loading it shows interpolation curly braces for a fraction of a second on the screen.
This is bad for UX.
How do i avoid this from happening?

answer
submitting answer...
submit
No answers yet. Be the first one to answer!
7 answers
Ravi Sharnagat Excited about New Web Technologies
{{::getFormatedLocalTime("2017-10-29T06:22:53.087Z", {without_time: true})}}

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.

Loading comments...
Abhinav Nigam Excited about New Web Technologies
{{::getFormatedLocalTime("2017-10-30T05:48:56.646Z", {without_time: true})}}

Use ng-bind instead of the interpolation. Given below is the example to use:

<div>

    {{message}}
</div>

should be converted to 

<div ng-bind="message"></div>

Subash Chandran Intrested in New Web Technologies
{{::getFormatedLocalTime("2017-11-03T06:53:36.367Z", {without_time: true})}}
"ng-bind" is the best way to do it. It even handles braces, if angular not loading properly or in case of some errors
Loading comments...
To view all answers to this question, join this channel
join this channel
Learn how Cutshort Channels work
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.
Okay
Privacy policy
File upload not supportedAudio recording not supported
This browser does not support file upload. Please follow the instructions to upload your resume.This browser does not support audio recording. Please follow the instructions to record audio.
  1. Click on the 3 dots
  2. Click on "Copy link"
  3. Open Google Chrome (or any other browser) and enter the copied link in the URL bar
Done