For those who wonder how to build a Todo app in different javascript frameworks, you should definitely check out TodoMVC: http://addyosmani.github.com/todomvc/
It is a great site to check out different frameworks/approaches/philosophies. There is also an example for the todo app written in Dart using Web Components (similar to AngularJS)
Maybe I'm misreading it, but it looks like you might have a typo in todos-router.js. See http://ahamlett.com/Backbone.localStorage/docs/todos-router...., in the call to define() -- your dependencies are 'jquery' and 'backbone', but you take in '_' and 'Backbone'. Then, you later use '$'.
> Also, we make Backbone, $ and _ globals so we don't have to inject them in every single module.
We don't; we explicitly define every dependency, always, so that it does not make any assumptions about the environment it runs in (a webpage with jquery / underscore included via script tags, for example). Second, our end-product is a single .js with Backbone and some other dependencies all combined into it. (we're not allowed to use a CDN)
I like the fresh take on organizing the example but I disagree with the 2nd bullet point. Jérôme Gravel-Niquet's example encapsulates everything inside of an anonymous function and I don't see any var leakage into the global namespace.
Maybe, I like to pretend it's a flask app and lump anything that models an api resource in the same folder. After all, a Collection is just an array of Models.
What do you think?
Probably should be named TodoCollection.js either way.
I think the todo app is not good enough to compare different frameworks maybe we should come up with another app , that has a least some ajax and a more complex business logic to handle.
I totally agree. The only problem is hosting the api for a new example app. I could write an example app using the github api requiring OAuth. Does anyone know of a public api that allows modifying resources without login?
CoffeeScript isn't for everyone. I've used it, and I really prefer JavaScript. While there's some nice things about it, I personally find it to be incredibly unreadable. (Sure, you can write a mix of JS and CS, but that just seems wrong.)
(That being said, I love LESS and can't imagine writing pure CSS, so I do understand how you feel.)