mirror of
https://github.com/S2-/ejs-render-remote
synced 2025-08-04 13:20:06 +02:00
Compare commits
4 Commits
c1f83b7468
...
37a2512f4b
Author | SHA1 | Date | |
---|---|---|---|
37a2512f4b | |||
326e760c78 | |||
95a1708280 | |||
c4fc133475 |
@@ -33,14 +33,14 @@
|
|||||||
|
|
||||||
var r = uuidv4();
|
var r = uuidv4();
|
||||||
getTemplateFn.then(function(template) {
|
getTemplateFn.then(function(template) {
|
||||||
document.getElementById(r).outerHTML = ejs.render(
|
$('#' + r).replaceWith(ejs.render(
|
||||||
template,
|
template,
|
||||||
data,
|
data,
|
||||||
{
|
{
|
||||||
cache: true,
|
cache: true,
|
||||||
filename: templateUrl
|
filename: templateUrl
|
||||||
}
|
}
|
||||||
);
|
));
|
||||||
});
|
});
|
||||||
|
|
||||||
return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>';
|
return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>';
|
||||||
@@ -57,17 +57,17 @@
|
|||||||
$.get(templateUrl)
|
$.get(templateUrl)
|
||||||
.then(function(template) {
|
.then(function(template) {
|
||||||
var templateFn = ejs.compile(template,
|
var templateFn = ejs.compile(template,
|
||||||
{
|
{
|
||||||
cache: true,
|
cache: true,
|
||||||
filename: templateUrl
|
filename: templateUrl
|
||||||
});
|
});
|
||||||
|
|
||||||
ejs.cache.set(templateUrl, templateFn);
|
ejs.cache.set(templateUrl, templateFn);
|
||||||
|
|
||||||
d.resolve();
|
d.resolve(templateUrl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
};
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ejs-render-remote",
|
"name": "ejs-render-remote",
|
||||||
"version": "1.0.1",
|
"version": "1.0.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"homepage": "https://github.com/S2-/ejs-render-remote",
|
"homepage": "https://github.com/S2-/ejs-render-remote",
|
||||||
|
Reference in New Issue
Block a user