私の bottom_index.ejs は次のようになります。
<div>The bottom section</div>
私のコードでは、ejs を宣言します。
ejs = require('ejs');
次に、関数をコンパイルします。
var botom_index_ejs =
ejs.compile(fs.readFileSync(__dirname + "/../views/bottom_index.ejs", 'utf8'));
それを呼び出して、レンダリングされた html を取得します。
botom_index_ejs()
それはうまくいきます!
ここで、テンプレートを次のように変更したいと思います。
<div><%= bottom_text %></div>
パラメータ(bottom_text)をbottom_index.ejsに渡すことができます
どのようにパラメータを渡す必要がありますか?
ありがとう!