TemplateLoader.js 292 B

12345678910111213
  1. class TemplateLoader {
  2. constructor() {
  3. this.cacheBusting = false;
  4. }
  5. async get(templateName) {
  6. let url = `./templates/${templateName}.html`;
  7. if (this.cacheBusting) {
  8. url += "?v=" + new Date().getTime();
  9. }
  10. return await system.ajaxGet(url, { "Content-Type": 'text/html' });
  11. }
  12. }