Friday 19 July 2013

backbone.js and node.js (using express/jade) notes

run express to generate default express project, then run 'npm install' to download dependencies.

Download following libraries and put in public/javscripts dir
Add these references to your public/views/layout.jade file

    script(src='/javascripts/json2.js', type='text/javascript')
    script(src='/javascripts/jquery-1.10.2.js', type='text/javascript')
    script(src='/javascripts/underscore.js', type='text/javascript')
    script(src='/javascripts/backbone.js', type='text/javascript')

At this point, I should remember that it's probably better to use Restify as the backend service or express without jade as backbone provides templating via underscore, however I will probably figure out how to add that in.

Useful: http://addyosmani.github.io/backbone-fundamentals

Basic todo / localstorage tutorial: https://github.com/jeromegn/backbone.localstorage