Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What would you suggest for a JS MVC framework? AngularJS vs Backbone.js

Been trying to take a dive into JS MVC Frameworks, but not sure which is better to start with

user-image
Question ajoutée par Hazem Salama , Senior Member of Technical Staff , Verizon Communications
Date de publication: 2013/04/04
Ahmed Zahran
par Ahmed Zahran , Senior Software Developer , Oracle

Backbone.js is a minimal model-view-controller (MVC) open-source library built on top of Underscore.js, and optimized for single-page applications, allowing you to easily update parts of the page as application state changes. very flexible, but it does not contain everything. AngularJS is way bigger, provides a much higher level of abstraction but it makes you learn a different syntax than JavaScript. It's a complete solution, with testing environment and philosophy behind it... That means, building an app is super fast, but it is often criticized for not being flexible.

Mohammad Arif
par Mohammad Arif , Principal Engineer UI , NatWest Group

Angular is much more then the backbone and so the learning curve, if you looking for SPA (Single Page Application) with some interactions similar to linked mobile (they have been using backbone.js too) then go for it. Angular has a high wow factor at the beginning. It can do some amazing things - like two-way bindings - without having to learn much. And it looks quite easy at first sight. But after you have learnt the very basics it is quite a steep learning curve from there. It's a complex framework with lots of peculiarities. Reading the documentation is not easy as there is a lot of Angular specific jargon and a serious lack of examples. The basic of Backbone are quite easy to learn. But soon you find that there are not enough opinions there to know how to best structure your code. You will need to watch or read a few tutorials to learn some best Backbone practices. You can find few comparisons below in terms of features. Data-binding The most prominent feature that separates the two libraries is in the way models and views are synchronized. Whereas AngularJS supports two way data-binding, Backbone.js relies heavily on boilerplate code to harmonize its models and views. REST Backbone.js communicates well with RESTful backends. A very simple use of REST APIs is also available with AngularJS using the $resource service. AngularJS also provide a $http service which is more flexible, connecting to remote servers either through a browser's XMLHttpRequest object or via JSONP. Templating AngularJS templating uses a combination of customizable HTML tags and expressions. Backbone.js uses different templating engines such as Underscore.js. It's again the choice which one needs to make and depending upon the comfort level to choose the one of them.

Utilisateur supprimé
par Utilisateur supprimé

I was asking the same question when looking which of JS MVC/MVVM framworks to pick for one of my projects. I finished by choosing KnockoutJS: - rich documentation and examples. - it is built from only JavaScript no other dependencies, hence no concerns about browsers compatibility (IE6 !). - You can use it on top of your existing web application with a less refactoring. - Mapping json to object and vice-versa with built-in functions. Your choice depends on the requirement you have, check this website http://todomvc.com/, it implement a basic "todo list" webapp with the existing JS frameworks. Hope it helps

MD Maruf Billah
par MD Maruf Billah , Mis Specialist , CARE Bangladesh

You can drive with angularjs for --

* Dependency Injection

* Two way data binding

* HTML attributes with Directives

* Huge resources

More Questions Like This