備忘録として。
共通関数ファイル
myFunctions.ejs
<%
myFunc = {
test: function(){ return "hello"; },
hoge: function(str){ return str; }
}
%>
Viewファイルとか
index.html.ejs
<% include('./myFunctions.ejs') -%>
<%- myFunc.test() %>
出力
hello
More than 3 years have passed since last update.
備忘録として。
共通関数ファイル
<%
myFunc = {
test: function(){ return "hello"; },
hoge: function(str){ return str; }
}
%>
Viewファイルとか
<% include('./myFunctions.ejs') -%>
<%- myFunc.test() %>
出力
hello
Register as a new user and use Qiita more conveniently