Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between angularjs and dust.js?

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:

  • Upgrading components is time consuming.
  • Module specification and identification is not easy.

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?

like image 995
Anil Avatar asked Mar 11 '13 10:03

Anil


People also ask

What is the difference between JS and AngularJS?

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.

What is difference between AngularJS and angular?

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.

Which is better AngularJS or JavaScript?

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.

Which is best Angular or AngularJS?

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.


1 Answers

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.

like image 178
Gawth Avatar answered Sep 17 '22 18:09

Gawth