Hello Backbone is a simple Backbone.js tutorial comprised of self-explanatory "hello world" examples of increasing complexity. It was designed to provide a smoother transition from zero to the popular Todos example.
Use:
docco *.js
in the root directory to compile the docs using Docco.
See it in action: http://arturadib.github.com/hello-backbonejs/
The original version was made 2 years ago. Some usages of backbone seems a little inappropriate today. Therefore, I made some modifications to match today's backbone. The main changes are as follows:
- use
el: 'body'
instead ofel: $('body')
- use
this.$el
directly instead of$(this.el)
- remove dummy
Backbone.sync.
It seems thatmodel.destroy()
would not raise any error - use
each
method ofcollection
instead of using it throughunderscore
- change
model.bind()
tomodel.on()
- update versions of backbone and underscore
The "See it in action" link does not work. So this is mine:
http://lujunweng.github.io/hello-backbonejs/
Some parts of the final example are kind of confusing, like addItem
and
appendItem
. I think some further examples could be built to show how to refactor
and make code structure better.