render templates from file

This commit is contained in:
s2
2019-03-06 10:47:42 +01:00
parent 5135dad48e
commit 3ad84f2617
6 changed files with 65 additions and 13 deletions

View File

@@ -4,15 +4,8 @@
n3wz.apiPrefix = '/api/';
}
$.when(
$.get('templates.ejs'),
$.getJSON(n3wz.apiPrefix + 'newsgroup/it.comp.console/threads')
)
.then(function(templates, threads) {
$('body').append(templates[0]);
$('.js-articles').html(ejs.rtfe('articles', {
threads: threads[0].threads
}));
$.getJSON(n3wz.apiPrefix + 'newsgroup/it.comp.console/threads')
.then(function(threads) {
$('.js-articles').html(ejs.rtfe('articles', threads));
});
})(jQuery);