Skip to content

Commit

Permalink
Allow EJS templates to use includes
Browse files Browse the repository at this point in the history
Simple change that allows templates to use includes.
  • Loading branch information
gausie committed Aug 27, 2015
1 parent ab3a950 commit ecc98fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/loopback.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ loopback.remoteMethod = function(fn, options) {
loopback.template = function(file) {
var templates = this._templates || (this._templates = {});
var str = templates[file] || (templates[file] = fs.readFileSync(file, 'utf8'));
return ejs.compile(str);
return ejs.compile(str, {
filename: file
});
};

require('../server/current-context')(loopback);
Expand Down

0 comments on commit ecc98fd

Please sign in to comment.