Question

This may come from a lack of experience on the various sections of the MEAN stack, but from the various boilerplates I've seen (mean.io, hackathon-starter, etc.) in the app.js code, there is always a call to using jade templating engine. I know that I can switch this to ejs and the like, but I was wondering if there's a means of doing it to where all of my pages are .html files using AngularJS? The components/templating features I'm interested appear to be in Angular already so I'm not sure what I'm losing if I were to attempt to server .html files instead?

Was it helpful?

Solution

If you have multiple html pages in your application, template engine can reduce code duplication between them.

Also, you usually need server-side template engine to provide some kind of a fallback to users who don't have javascript turned on (+ search engines).

I prefer jade over other template engines (and plain html), precisely because it's not html. So it doesn't have certain html issues like whitespace nodes, and always compiles into well-formed html file.

OTHER TIPS

If you follow meanjs.org it uses swig, which parses as HTML. You may consider doing the same?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top