nodejs 模板 ejs 入门 helloworld
2015-08-26 12:09
671 查看
npm isntall ejs
var ejs = require("ejs"); var tpl = "<% myList.forEach(function(item){ %>hello <%=item%> <br /> <% }) %> "; var data = {"myList":["hehe","xixi"]}; console.log(ejs.render(tpl,data));
参考文档:https://www.npmjs.com/package/ejs
相关文章推荐
- Swap Nodes in Pairs
- nodejs加密解密
- MSXML中的SelectNodes和SelectSingleNode
- 后端分布式系列:分布式存储-HDFS DataNode 设计实现解析
- 后端分布式系列:分布式存储-HDFS DataNode 设计实现解析
- 后端分布式系列:分布式存储-HDFS DataNode 设计实现解析
- HDFS DataNode 设计实现解析
- [LeetCode] Swap Nodes in Pairs
- Leetcode: Delete Node in a Linked List
- Delete Node in a Linked List
- Name node is in safe mode.
- iOS Node Conflict svn冲突
- node-zk-browser安装配置
- node.js(八) 有趣的东西才开始哦
- 基于node-red工具实现自定义节点
- [leetcode] 117.Populating Next Right Pointers in Each Node II
- CCCamera,CCAtlasNode源码解析
- CCClippingRectangleNode,CCClippingNode源码解析
- node.js(七) 子进程 child_process模块
- node.js(六) UTIL模块