节点,棱角分明,前preSS和视图引擎 [英] Node, Angular, Express and the view engine
问题描述
我采用了棱角分明,节点和Ex preSS最近开始。我曾在一些角工作基于浏览器的应用程序,并在尝试将其移植到在节点和Ex preSS服务器应用程序。 (特别是,一会拉从Twitter和其它数据从Wikidot。)
I recently started using Angular, Node and Express. I have made some working browser-based applications in Angular and am attempting to port them to server applications in Node and Express. (In particular, one will pull data from Twitter and another from Wikidot.)
由于我采用了棱角分明的数据注入和模板,我不想使用其他视图引擎,如EJS或翡翠。我想使用HTML /角$ C $,我已经写用尽可能少的修改尽可能℃。我,为什么前preSS要求我有一个观点引擎非常困惑。
Since I am using Angular for data injection and templating, I do not want to use another view engine such as EJS or Jade. I want to use the HTML/Angular code that I have already written with as little modification as possible. I'm very confused as to why Express requires me to have a view engine.
是什么让这个code工作作为一个节点/ EX preSS应用程序最简单的方法?
What is the simplest way to get this code working as a Node/Express application?
推荐答案
我一直在寻找的答案是这条线code的。
The answer I was looking for is this line of code.
app.engine('html', require('ejs').renderFile);
这篇关于节点,棱角分明,前preSS和视图引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!