• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
BackboneJs
 

BackboneJs

on

  • 2,246 views

 

Statistics

Views

Total Views
2,246
Views on SlideShare
2,245
Embed Views
1

Actions

Likes
4
Downloads
50
Comments
0

1 Embed 1

https://duckduckgo.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    BackboneJs BackboneJs Presentation Transcript

    • Agenda By Jeremy Ashkenas SBR Department
    • Lightweight
      • < 1200 Lines of code
      • No UI Widgets
      • Pre-requisites ( HTML , Css and Basic JavaScript)
      • Use Jquery and underscorejs Internally
    • Backbone.Model What do they do?
      • Store Data
      • Fire Events when data is changed
      • Provide get/set Accessors
      • Does the data persistance ( save method )
    • eg:Model
      • GridModel = Backbone.Model.extend();
      • Or
      • GridModel = Backbone.Model.extend({
      • defaults:{
      • }
      • });
      • var gridModel = new GridModel();
      • gridModel. get (“key”); // only one level
      • gridModel. set ({“key”:”value”}); //does the writing
    • Backbone.View What do they do?
      • Display data
      • Render data with template
      • Respond to model data changes
      • Act on user input entries
    • eg:View
      • GridView = Backbone.View.extend({
      • initialize:function(){
      • _.bindAll(this, 'render','remove');
      • this.template = _.template( $(“#grid-template”).html());
      • },
      • render:function(){
      • var rc = this.template( this.model.toJSON());
      • $(this.el).html( rc );
      • return this;
      • }
      • });
      • var gridView = new GridView( {model:gridModel});
    • Backbone.Collection What do they do?
      • Listen to&quot;add&quot; and &quot;remove&quot; events
      • Fetch data model from server
      • Act on user input entries
    • Eg: Collection
      • var GridModels = Backbone.Collection.extend({
      • model:gridModel
      • });
    • Backbone.Router What do they do?
      • Routing the applications URL's when using hash tags(#).
      • Manage history
    • Extras
      • Sinon.JS
    • Trends Support
    • Resources
      • Official url for Backbone Js
      • http://documentcloud.github.com/backbone/
    • Any questions?