javascriptangularjsnode.jsviewenginevash

Node view engines using Angular


Is there a node view engine that works in conjunction with Angular? Coming from a .NET background VASH seemed like it'd make the most sense however I wasn't able to render a basic {{ 1 + 3 }} expression to ensure my Angular import is working. I also tried making just a plain 'HTML' index page but I got an error saying I needed a default engine. Am i supposed to simply write up html and read it as a file then serve the page? Doing it this way, do I lose out on using layouts? Some direction and ideas would be appreciated, Thanks


Solution

  • Currently, Angular 1.x (which I assume you're using) does not work with server-rendered pages. The typical pattern (such as in MEAN) is to consume a RESTful API with Angular, decoupling front-end and back-end.

    Angular 2.0 will allow server-rendering and Angular Universal is the project to follow for that.