2

A client of mine has an issue with his AngularJS Project that during the loading, some interpolations are rendered as text before they are replaced with the proper content. I haven't encountered this behavior before. Does anyone know what they might be doing wrong?

enter image description here

4
  • 3
    That's perfectly normal. See docs.angularjs.org/api/ng/directive/ngCloak Commented Sep 27, 2019 at 16:57
  • 1
    Note that your client isn't using Angular. It's using AngularJS. Commented Sep 27, 2019 at 16:57
  • Thank you @JBNizet - Angular was what they've told me, hadn't had the chance to look at code yet. so they just have to apply that ngCloak directive to hide slow-rendering components? Can slow async requests in the components affect the slow overall rendering time of the components ? Commented Sep 27, 2019 at 17:16
  • 1
    All you have to do is use ng-cloak in your parent tag. Commented Sep 27, 2019 at 19:36

1 Answer 1

1

Use the ng-cloak directive to avoid the undesirable flicker effect caused by the html template display.

From the Docs:

The ngCloak directive is used to prevent the AngularJS html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading.

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.

For more information, see

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.