search

Home  >  Q&A  >  body text

node.js - Parameter passing problem in node+express+ejs. When passing parameters, it always prompts that the parameters are undefined.

Brief description of the structure:

index.ejs:显示数据
list.ejs:后台获取到的数据列表模板
admin.js:数据渲染文件,用来获取后台数据的

The connection between the three is to get all the articles in the database through admin.js, pass them to list.ejs through locals.list, and then render list.ejs to the index.ejs part.
index.ejs

The following is a list of background data obtained through include introduction

Find ejs online 2.0 You can pass parameters through <%- inclund("article/list",{list:locals.list}), but no parameters are received in list.ejs. The console still reports an error
list.ejs

admin.js


The following is the error message

给我你的怀抱给我你的怀抱2754 days ago1118

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-06-05 11:10:33

    Everyone who has passed by can give me your opinion

    reply
    0
  • Cancelreply