Is it possible to build angularJS apps with plain HTML, ExpressJS on NodeJS ?
Jade is a template engine for node. js and the default rendering engine for the Express web framework. It is a new, simplified language that compiles into HTML and is extremely useful for web developers. Jade is designed primarily for server-side templating in node.
NodeJS takes part in loading the AngularJS application with all the dependencies, such as CSS files and JS files in the browser. For loading all the assets of Angular and accepting all the API calls from the AngularJS applications, NodeJS is generally used as a web server.
You do need Node. js to develop Angular applications. All the tools you will run, while developing it, uses Node. js to run, like npm and the Angular CLI itself.
Node. js is more preferable when faster and scalable web development is needed. It is usually used for building small-sized projects. Angular is preferred when real-time applications, for example, chat apps, or instant messaging are needed.
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';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With