4 ms·
Another framework worth checking out if you're into JavaScript MVC is AngularJS (http://angularjs.org http://angularjs.org).
by jonascopenhagen 14y ago
Another framework worth checking out if you're into JavaScript MVC is AngularJS (http://angularjs.org http://angularjs.org).
- graue 14y agoI'd be interested to hear from anyone who's used both Backbone and Angular. I've been writing my first single-page app (yeah, yeah, behind the times) using Backbone, and at first it was really exciting and intuitive, but I'm starting to realize Backbone is a pretty, er, bare-bones lib. Everyone seemed to suggest Handlebars as a template lib, so I added that to my project, and RequireJS to manage those two libs and their dependencies, and the RequireJS text plugin to load templates from other files in the project, and now it all just seems like a mess. The promise of a framework with everything you need, right out of the box, is tempting. Edit: Most of the alternatives (e.g. Ember, Angular, Knockout, Meteor, etc.) are already in my bookmarks. I'm looking for reports from people who actually used the things, not links.
- philfreo 14y agoFor more complete frameworks around Backbone, try: https://github.com/tbranyen/backbone-boilerplate https://github.com/tbranyen/backbone-boilerplate http://walmartlabs.github.com/thorax/ http://walmartlabs.github.com/thorax/ https://github.com/marionettejs/backbone.marionette https://github.com/marionettejs/backbone.marionette https://github.com/chaplinjs/chaplin https://github.com/chaplinjs/chaplin Outside of Backbone, there's also http://emberjs.com/ http://emberjs.com/
- LandoCalrissian 14y agoI think even going at step farther and throwing in Knockout too. I agree with everything you said about Backbone.
- jaredmcateer 14y agoThat's pretty much it. If you're into having absolute control over your code and how it's structured Backbone is where it's at, if you don't want to deal with the plumbing and don't mind the framework having an opinion on how your write and structure code, then angular is probably for you.
- tlarkworthy 14y agoI write and use alot of software. Normally number crunching on servers. However, I recently started seriously learning javascript. I had avoided HTML/javascript for years as they were horrible systems to develop in compared to every other type of software system in existence. However, with HTML 5 + cloud computing platforms I thought these systems are probably mature enough to start using. Anyway, so I learnt javascript and have now built 2 cloud apps. The first was to learn the basic ropes of GAE with JS. The second one is much nearer to to what I would consider complicated (but still one hop from my final target app). I realised plain JS wasn't scaling (regarding software entropy) so I looked at frameworks that could tidy things up. Note I have plenty of experience choosing software APIs to connect different systems together, but next to no experience of JS specifically. Anyway I tried backbone and I was like "is that it? the JS community is blown away by a fricking event model?". It seems trivial to me. Then I tried AngularJS and I was blown away. "Yes!" I exclaimed "JS/HTML5 has truly come of age". It is a beautiful thing that saves shit tons of time. And as I have got deeper into it, I hardly write JS anymore, YOU CAN DO 95% OF PRESENTATION LOGIC IN THE HTML. You can modularise. You can ... test! Its amazing. IT WILL ENABLE YOU TO STRUCTURE REALLY REALLY BIG PROJECTS! I hear similar evangelism from the knockoutJS community, so I am keen to try that out too, although I am getting pretty proficient with AngularJS and I personally think its got more chance of survival given its googly backers, and its more likely that chrome will start supporting AngularJS features natively. So I am betting on longevity as well as functionality with NG.
- aerolite 14y agoUgh, but this is just terrible: <input type="checkbox" ng-model="todo.done"> I guess I'm a purist.
- deleted 14y ago[deleted]
- testing12341234 14y agoAngular supports many styles of markup. Other valid forms of that snippet are: Using xml namespace: <input type="checkbox" ng:model="todo.done"> Using underscore in the attribute name: <input type="checkbox" ng_model="todo.done"> As an x-* attribute: <input type="checkbox" x-ng-model="todo.done"> As a HTML5 data attribute: <input type="checkbox" data-ng-model="todo.done"> I think their may be a few more, but in any case, Angular is flexible enough that you can choose the representation that is best for you and your team.
- sideproject 14y agoExactly the question I had yesterday. http://stackoverflow.com/questions/6548826/angular-js-vs-backbone-js http://stackoverflow.com/questions/6548826/angular-js-vs-bac...
- graue 14y agoThanks. Although it was closed (not surprising due to StackOverflow's policies), it happens that there are some great answers there.
- camus 14y agoBeen using AngularJS to reproduce a Backbone App : markme (in AngularJS) : http://markme.alwaysdata.net/ http://markme.alwaysdata.net/ which is a clone bookmarly.com , done with backbone. The source is here : https://github.com/Mparaiso/silex-bookmarkly https://github.com/Mparaiso/silex-bookmarkly AngularJS is great , it doesnt do everything so you still need to build your own stack, as for backbone ( jquery ,bootstrap, and even requirejs as it doesnt do AMD out of the box ... ). It comes with a lot of testing tools , make it easy to mock backends , DOM elements ... It is the best frontend framework for LOB , period. It has builtin form support , filtering , validation , is easy to integrate with bootstrap , and extend , and produce sane code , unlike ExtJS for instance( SenchaTouch is however very good for mobile apps , it is blazing fast. ). If you are doing some animation heavy stuff ,where you need total control over dom elements lifecycle , i would not recommand it, backbone is better for that , i still use backbone for data light apps.
- account_taken 14y agoIf you like jQuery and DOM use Backbone. AngularJS does a lot more than Backbone and Angular forces you to do things its way, meaning to avoid doing DOM manipulation outside of the framework, which isn't necessarily bad but requires more of a commitment and learning. AngularJS is great for simple apps but once I got beyond that I ended up fighting how to makes things work with the ng-* attributes often having to resort to $apply. Things that are simple with underscore templates and jQuery (the Backbone way) can become very frustrating in AngularJS. AngularJS reminds me of ASP.NET controls with repeaters and coding through attributes. That works for a lot of people but I'm more comfortable with templates and jQuery.
- plq 14y agoI've been using qooxdoo for a while. It lets you write cross browser js like you write qt. Worth checking out.
- snprbob86 14y agoI've worked on a reasonably large Backbone app in production and I've written several toy apps with Angular. I think that a lot of people dismiss Angular as yet-another-mvc-framework without ever discovering the key elements of Angular that are actually novel and worthy of study. Personally, I think that Angular is a local maximum in client-side JavaScript app development. But even if you don't agree, you should at least understand how it is different. 1) Angular prefers declarative This doesn't mean you don't write procedural code. This means that if you want to do something proceedural, you should package it up as a Directive. Directives are where behavior and logic live. Your templates simply arrange and parameterize a tree of directives. This means that you have limited and well understood moving parts that can be tested in isolation, in combination, or in the application context. Contrast with the traditional big bag of event callbacks, which can only be tested in the application context and are more difficult to re-use in other application contexts. 2) Angular works like a game engine Most traditional UI frameworks are a graph of intertwined callbacks. Games, however, traditionally have a pair of functions called Update and Render. The Update functions permutes the world and the Render function draws the new world. Angular works similarly, but it might not be immediately obvious. There is a "Dirty Checking" pass, where your view models, a simple hierarchy of poorly-named "scopes" are essentially diff-ed against the previous iteration. Then the Directives take over and permute the DOM to match the new view model. Let's call the "Controller" part of the "ViewModel" and then just simplify that down to "Model". Inherently, Model and View systems are co-dependent. You have a graph like M <--> V. Angular's system graph is less like single bi-directional edge, and more like two directed edges in a cycle. That makes little difference when viewed abstractly with the two subsystems as nodes. However, once you break M and V down into subgraphs, the traditional Model & View systems look like a spaghetti mess of bi-directional relationships. An Angular application, on the other hand, would look like less like a lattice and more like a circle.
- corresation 14y agoThe promise of a framework with everything you need, right out of the box, is tempting. There is always the compromise, however, in that frameworks that have "everything" tend to force you to abide by their view of the world. AngularJS, for instance, offers many arguable advantages for some tasks, but can turn into an enormous impediment whenever you want to go outside of the painted lines. Of course opinions differ, but I prefer that relative simplicity of backbone -- it is more convention than framework, really -- because it scales to full-products with less friction.
- marekmroz 14y agoI found the JavaScript Jabber podcast [1] to be a great source of information on front-end JavaScript Frameworks, as well as some discussion with framewor authors that can help figure out how they differ. Backbone: http://javascriptjabber.com/004-jsj-backbone-js-with-jeremy-ashkenas/ http://javascriptjabber.com/004-jsj-backbone-js-with-jeremy-... Ember: http://javascriptjabber.com/034-jsj-ember-js/ http://javascriptjabber.com/034-jsj-ember-js/ Angular: http://javascriptjabber.com/032-jsj-angular-js/ http://javascriptjabber.com/032-jsj-angular-js/ Knockout: http://javascriptjabber.com/013-jsj-knockout-js-with-steven-sanderson/ http://javascriptjabber.com/013-jsj-knockout-js-with-steven-... enyo: http://javascriptjabber.com/033-jsj-enyo-js/ http://javascriptjabber.com/033-jsj-enyo-js/ [1]http://javascriptjabber.com/ http://javascriptjabber.com/
- pradeepin 14y agoI have used backbone and angular, created a small Quiz application in both the frameworks. I would say with Angular, what you write is not javascript , it is Angular JavaScript, which gets compiled into javascript on running over compiler. Having been worked with GWT for many years, I am disappointed with Angular doing the same mistakes of not allowing the developers to think in terms of Javascript. But in terms of the framework, which they had brought in. However, Backbone gives me lot of freedom in customizing the app by adding Javascript and using its model view observable logic. If i find any shortcoming in backbone, i can see a plugin available in the Community. Which is really great. To conclude , If your are experienced JS developer (JS ninja), you will love backbone. If you are intermediate/beginner JS developer you will love angular. However, this is just my perspective.