Under the Express framework, use the Ejs template engine:
Express-partials module is required to support default layout layouts;
Use include to replace partials;
The clip view is also displayed in the same way as the 3.x version, using the following method:
Routers/index.js Add:
Router.get ('/list ', function (req, res) {res.render (' list ', {layout:false, title: ' Express ', Items: [' 1 ', ' 2 ', ' 3 ', ' 4 '});
Views/list.ejs:
Run, Input: http://127.0.0.1:3000/list
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/45/2B/wKiom1PkIuPwVlGxAABrc-cDuqo660.jpg "title=" 2014-08-08 09:07:00 screen. png "alt=" wkiom1pkiupwvlgxaabrc-cduqo660.jpg "/>
Reference: node. js template Ejs using include in Express Ejs 3.* instead of partial and layout
Ejs and alternative include implementations
This article is from "Whispering Autumn Wind" blog, please be sure to keep this source http://xjhznick.blog.51cto.com/3608584/1537280