What is the difference between angularjs and dust.js?
Asked Answered
C

1

10

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?

Carlyle answered 11/3, 2013 at 10:24 Comment(1)
Angular per say is a full fledged framework, and has a inbuilt templating engine,so it cannot be compared with with dust.js. Comparison between backbone+dust may be a fair one and googling may help. As much I am aware of backbone, any migration would be non trivial as both framework follow a different approach for building a html page.Aeronautics
M
10

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.

Musset answered 15/11, 2013 at 22:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.