Reputation: 1607
Recently, I started reading Jade and I have an experience of working with AngularJS.
I came across certain scenarios where people are using Jade along with AngularJS.
However what I understand is that if we are using AngularJS, we can use AngularJS features(directives majorly) and can avoid Jade.
Any suggestions?
Upvotes: 2
Views: 3915
Reputation: 2373
Here are some points for your answer :
Jade is a template engine for HTML
Basically used for fast processing of HTML
If you are working with AngularJs then you don't need to use JADE
You can define HTML engine with Angularjs & Node.js like this :
app.set('views', path.join(__dirname, 'views'));
app.engine('html', require('jade').renderFile);
app.set('view engine', 'html');
Using HTML instead of Jade makes easier for you to understand HTML code.
Jade has a fallback of using its indent and spacing. It makes bottleneck task for anyone to manage spaces or indents/tabs.
Angular mostly works with dynamic content and uses XHR requests and response so using JADE according to me isn't good idea at all.
Currently I'm working with MEAN stack in which I use HTML with Node & Angular. And hence for my personal views. I should say that plain HTML is best to used rather than any templating engine like JADE, EJS, etc.
Upvotes: 3
Reputation: 46046
Jade is just a view engine on the server-side which makes your HTML templates much less verbose with it's cool syntax. Whereas AngularJS runs on the browser (client-side). You can use Jade templates in conjunction with AngularJS, that's what I'm currently doing on one of my projects.
To be honest it has not been a good practice and using them together makes the job a bit confusing but les verbose.
Upvotes: 0
Reputation: 111
Jade is simply a way to preprocess HTML, while Angular will bind data from the controller to the view and vice versa, which can be updated through client events.
Upvotes: 0