从玉模板更改为EJS为MEAN堆栈 [英] Change from Jade template to ejs for MEAN Stack

查看:155
本文介绍了从玉模板更改为EJS为MEAN堆栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前新的使用MEAN堆栈以下软件包: https://github.com/linnovate/mean 。不过,我已经创建的项目,后发现翡翠是其默认的模板引擎。

I am currently new to use MEAN stack with the following packages: https://github.com/linnovate/mean. However, after I had created the project and found that Jade is their default template engine.

有没有什么好的方法来那些玉模板转换EJS与前preSS更改相关设置?

Are there any good ways to convert those jade template to ejs with changing related settings in Express?

感谢您。

推荐答案

app.js将里面:

Inside app.js change:

app.set('view engine', 'jade');

app.set('view engine', 'ejs');

然后


  1. 在Chrome浏览器中打开您的基于玉页。

  1. Open your jade-based page on chrome browser.

打开浏览器的鼠标上下文菜单并选择检查元素。

Open the mouse context-menu on browser and select "inspect element".

选择HTML标记,并将其复制为HTML。

Select the html tag and copy it as HTML.

这是你最喜欢的HTML编辑器或任何code编辑粘贴HTML。

Paste that HTML on your favorite HTML editor or any code editor.

调整一些标记以适应EJS。例如,将块体到<% - 身体%>或改变任何数据串数据变量像{{数据}}或放大器; QUOT;以'。

Adjust some tags to fit to 'ejs'. For example, change 'block body' to '<%- body%> or change any data string to a data variable like {{data}} or & quot; to " ' ".

保存文件,EJS,而不是玉。

save the files with ejs instead of jade.

这篇关于从玉模板更改为EJS为MEAN堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆