📜  ejs js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:35.162000             🧑  作者: Mango

代码示例5
let str = "Hello <%= include('file', {person: 'John'}); %>",
      fn = ejs.compile(str, {client: true});

fn(data, null, function(path, d){ // include callback
  // path -> 'file'
  // d -> {person: 'John'}
  // Put your code here
  // Return the contents of file as a string
}); // returns rendered string