mirror of
https://github.com/S2-/ejs-render-remote
synced 2025-08-03 13:00:04 +02:00
Compare commits
4 Commits
8c9f23ce3f
...
47459bd322
Author | SHA1 | Date | |
---|---|---|---|
47459bd322 | |||
6ed2b48d36 | |||
23d46035e8 | |||
1c720ce9f3 |
@@ -40,11 +40,15 @@
|
|||||||
getTemplateFn.then(function(template) {
|
getTemplateFn.then(function(template) {
|
||||||
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
||||||
|
|
||||||
$('#' + r).replaceWith(ejs.render(
|
try {
|
||||||
template,
|
$('#' + r).replaceWith(ejs.render(
|
||||||
data,
|
template,
|
||||||
templateOptions
|
data,
|
||||||
));
|
templateOptions
|
||||||
|
));
|
||||||
|
} catch(ex) {
|
||||||
|
console.error(templateUrl, ex);
|
||||||
|
}
|
||||||
|
|
||||||
//clean up the getFnFor
|
//clean up the getFnFor
|
||||||
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {
|
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {
|
||||||
@@ -66,7 +70,13 @@
|
|||||||
$.get(templateUrl)
|
$.get(templateUrl)
|
||||||
.then(function(template) {
|
.then(function(template) {
|
||||||
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
||||||
var templateFn = ejs.compile(template, templateOptions);
|
try {
|
||||||
|
var templateFn = ejs.compile(template, templateOptions);
|
||||||
|
} catch(ex) {
|
||||||
|
console.error(templateUrl, ex);
|
||||||
|
d.reject(ex);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
ejs.cache.set(templateUrl, templateFn);
|
ejs.cache.set(templateUrl, templateFn);
|
||||||
|
|
||||||
d.resolve(templateUrl);
|
d.resolve(templateUrl);
|
||||||
|
@@ -1 +1 @@
|
|||||||
Hello <%= name%>!
|
Hello <%= name %>!
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ejs-render-remote",
|
"name": "ejs-render-remote",
|
||||||
"version": "1.0.7",
|
"version": "1.0.9",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"homepage": "https://github.com/S2-/ejs-render-remote",
|
"homepage": "https://github.com/S2-/ejs-render-remote",
|
||||||
@@ -9,5 +9,9 @@
|
|||||||
},
|
},
|
||||||
"author": "s2 <s2@31337.it>",
|
"author": "s2 <s2@31337.it>",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"keywords": ["ejs", "templating", "client-side"]
|
"keywords": [
|
||||||
|
"ejs",
|
||||||
|
"templating",
|
||||||
|
"client-side"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user