2. Backbone
● A javascript MVC framework
● Same stuff but on the client side
● Lets you focus on presentation logic
@scottcowan
3. Backbone
● Model – View - Controller
– M = Backbone.Model, Backbone.Collection
– V = HTML Templates
– C = Backbone.View
@scottcowan
4. Backbone
● initialize: function(){} is the constructor
● Doesn't give you the best debug messages
● Great for testing (jasmine, sinon)
● Event based logic flow
@scottcowan
5. Backbone
● Backbone.Router
– Single Page Application magic maker
– Change the url without a page load
– Backwards compatible with #/path
– Remember to setup routes on the server
@scottcowan
7. Backbone
● Backbone.View
– Something that's going to be an element
– Allows for Nesting (ie: TableView, RowView)
– Can handle events (ie: click, keydown)
– Has special fields (ie: tagName, className)
@scottcowan
8. Backbone
● Backbone.Model
– A single item of data
– Uses CREATE, PUT methods when saving
– Fires events like change or field changes
● http://backbonejs.org/#Events-catalog
@scottcowan
12. RequireJS
● use require.config after loading require
● use absolute links not relative
– Your site might not work off the root
● Use a path shortcut
– Ie: ['path/file'] for aura.js in the aura path
@scottcowan
14. Underscore
● Power library for collections
– contains, some, groupBy
– each – loops over Backbone collections
● And Arrays
– _.first, _.last, _.union
@scottcowan
15. Underscore
● Utility functions
– bindAll – adds functions to the context
– mixin – add global functions!
● More info at http://underscorejs.org/
@scottcowan