render templates from file
This commit is contained in:
13
js/index.js
13
js/index.js
@@ -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);
|
||||
|
Reference in New Issue
Block a user