0

I'm making an Expressjs app however I don't particularly want to use Jade. I installed UnderscoreJS successfully into my app so I can use its templating capabilities (as well as some of its other features).

My question is when I want to insert, for example, the current year into my html docs ( #{+new Date().getFullYear()} in Jade), where should I do so?
Is it possible to insert into the HTML file directly or should I set a variable equal to the result in the routes file and then send it to a <%=year%> tag in my html file?

2
  • have you considered using EJS? Commented Jun 26, 2012 at 9:44
  • I was hoping to have some of the other features of Underscore but having taken a second look at it, I may just settle on EJS. Still open to ideas though. Commented Jun 26, 2012 at 17:15

1 Answer 1

1

As per my comment, EJS would be a good option I think.
You can also use Underscore with EJS - How can I use Underscore.js templates in conjunction with EJS?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.