1

I am new to node.js and at the moment I am trying to wrap my head around template engines. It seems like all the tutorials I find on using Angular.js with Node.js are always accompanied with Express.js.

Do I need Express.js to use Angular.js with Node.js? If so, why?

What is the relationship between Express and Node/Angular?

What in the world is a template engine?

Why did I not need a template engine for PHP?

    1 Answer 1

    1

    You don't need to use Express for Angular. You could use another framework or just the plain node.js core http/https server directly. Express just incorporates abstractions and conventions on top of the built-in node.js http/https server to make it easier to write your backend logic.

    See wikipedia for both a good overview of what a template engine is and a list of example template engines.

    Template engines aren't necessary to generate output, but they can certainly aid you in that process by making it easier/simpler to compose output, instead of manually concatenating or echoing a bunch of strings for example. PHP kind of has a "template" built-in, in that output buffering is used such that you can just inject <?php ?> blocks anywhere in the output. This is similar to many template engines, including ejs, except ejs can save the template as a reusable function instead of throwing it all away once the request is done).

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.