I am currently using the Backbone philosophy which involves dust.js for template style. Recently I came across AngularJS, which extends the HTML syntax with custom elements and attributes.
Cons of Backbone+dust.js environment:
If I move my functionality to AngularJS will it be helpful or does it feel the same?
Can anyone explain to me what the major differences among these two libs are, as they seem similar to some extent?
JavaScript is a scripting language that is used to generate dynamic HTML pages with interactive effects on a webpage that runs in the web browser of the client. On the other hand, Angular JS is a framework that is built on JavaScript and adds new functionalities to HTML.
The main difference between AngularJS and Angular is that AngularJS is based on JavaScript, while Angular is based on TypeScript. There are several similarities between these two front-end, open-source frameworks that are used to create dynamic web applications and SPAs.
JavaScript is fast in comparison to AngularJS. It is slow in comparison to JavaScript. It does not support dependency injection. While it supports both dependency injection and data binding.
Each version of Angular has significant benefits, but there is much to gain in being up-to-date with the latest version. Angular is decidedly faster than AngularJS, has a mobile-driven approach, executes better with components, and enables smoother migration from earlier versions.
dust.js is purely a templating module. So, it allows the combination of json with a template to deliver html output.
Angular.js is client side framework that allows binding of logic to variables defined in a template (your page).
So, with dust.js you are responsible for deciding when to run the json through the template. Typically you feed in the json on the server (or client) and ask it to render the results.
With angular.js when the model (the json) changes the framework re-renders as appropriate. Triggers for that change could be user actions (such as filling a form in) or it could be due to loading some fresh json from a service.
Typically you would use angular.js if you want a single page JS app (think gmail). dust.js is perhaps more akin to a traditional approach with multi pages with content driven by passing in json.
You could even use the both of them in tandem - server side rendering using dust.js with dynamic client side logic in angular.js.
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