鍍金池/ 問答/Linux  HTML/ 使用ejs調用函數出錯

使用ejs調用函數出錯

問題描述:使用ejs,調用函數一直報錯。
代碼:
filter.js


var moment = require('moment');
var ejs = require('ejs');

ejs.filters.circle = function(d1, d2) {
    console.log('運行到這。。。。。');
    return d1;//測試
}
module.exports = {
    "circle": circle
};

routers.js

app.get('/index', function(req, res) {

    res.render('index.ejs', {
        data : someData
    });

});

index.ejs

<%=: data1 | circle: data2 %>

報錯:

clipboard.png
請各位大神看看,要怎么解決?

回答
編輯回答
澐染

circle這個自定義函數調用方面的錯誤。

2017年7月27日 22:00