DEV Community

Discussion on: Include HTML-in-HTML: an iteration

Collapse
 
fjones profile image
FJones

Neat! Glad someone got around to doing this before I did.

A slight improvement would be to allow the loading placeholder to be supplied through config or templates, which would also make this neatly integrated with React et al.

Collapse
 
lionelrowe profile image
lionel-rowe • Edited

Nice suggestion! Changed it so it'll only show the default loading message if it's empty:

<include-html src="./example.html"></include-html> <!-- Shows "Loading..." -->

<include-html src="./example.html">
    <div class="spinner"></div>
</include-html> <!-- Shows custom spinner -->
Enter fullscreen mode Exit fullscreen mode