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?
-
3That's perfectly normal. See docs.angularjs.org/api/ng/directive/ngCloakJB Nizet– JB Nizet2019-09-27 16:57:15 +00:00Commented Sep 27, 2019 at 16:57
-
1Note that your client isn't using Angular. It's using AngularJS.JB Nizet– JB Nizet2019-09-27 16:57:33 +00:00Commented 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 ?n1cK– n1cK2019-09-27 17:16:46 +00:00Commented Sep 27, 2019 at 17:16
-
1All you have to do is use ng-cloak in your parent tag.Harshad– Harshad2019-09-27 19:36:43 +00:00Commented Sep 27, 2019 at 19:36
Add a comment
|
1 Answer
Use the ng-cloak directive to avoid the undesirable flicker effect caused by the html template display.
From the Docs:
The
ngCloakdirective 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
