html briefly displayed when page is loading

Viewed 2565

In my Angular app, my menu component html code is displayed briefly when the page is loading. Even if I hide the menu html root element with a display none css, the html is still displayed when the page start loading. I have read a lot of thing about ng-cloak (https://docs.angularjs.org/api/ng/directive/ngCloak) but it seems Angular 4 not have ngCloak.

So I don't know how to prevent this unpleasant effect.

does Angular 4 have an equivalent directive for ng-cloak? How can I display properly page without display unstyled html on load?

5 Answers
Related