kasimoglou
kasimoglou

Reputation: 384

Angular ng-cloak wait child directive template to load

My problem is that when I use ng-cloak in pages that include elements which make use of directives with template code, ng-cloak does not wait for this template code to load and the page is shown incrementally and not as a whole (page elements first and after a while template code pops out).

I have tried to make a custom ng-cloak directive so that it won't remove element's ng-cloak class while any child element contains ng-cloak class but with no success. I thought this one would be a common issue, but I have not managed to find a solution online. Any help appreciated!

Upvotes: 1

Views: 1202

Answers (1)

Benny Bottema
Benny Bottema

Reputation: 11493

I don't think ngCloack was designed to cloak your content until everything is loaded. It is designed to prevent your content to be rendered in its raw form, what with expressions and all.

However, according to the documentation, it might work on the body element, but I haven't verified it myself:

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.

Upvotes: 1

Related Questions