Is it necessary to use JADE when building Angular Apps with Node and Express? Is it necessary to use JADE when building Angular Apps with Node and Express? angularjs angularjs

Is it necessary to use JADE when building Angular Apps with Node and Express?


No it is not necessary, you can use different templating engines with Node & Express or you can just send pure HTML files.

Jade is just a default templating engine that comes with Express.js, If you want a templating engine that is close to bare html i think dust.js is a good one.

Quite frankly angular.js has nothing to do with this.

You can set up express to render pure html files like this.

app.configure(function(){  app.set("view options", {     layout: false  });  app.register('.html', {    compile: function(string, options){      return function(locals){        return string;      };    }  });});

Then just render like this

app.get('/myUrl', function(request, response){  response.render("index.html");});

or, when I was using ember on the frontend it was so conflicting to write handlebars templates in jade templates, so in my jade template I simply included a pure html file like this.

include '/handlebars/templates.html';


Yes, it is possible. Jade is a (primarily – and I imagine it’s how you’re using it) server-side template engine. Angular bases itself off the HTML served to the client; it doesn’t matter what produced it. NodeJS is just a server. Express is just a server-side framework.

Angular can even work without a server; see jsFiddle, for example.


EJS is another framework that is popular with express and is pretty close to just bare HTML.