Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Ambitious Web Applications With Ember.js

Building Ambitious Web Applications With Ember.js

Web Unleashed 2012 Presentation

Christopher Meiklejohn

November 09, 2012
Tweet

More Decks by Christopher Meiklejohn

Other Decks in Programming

Transcript

  1. App.Person = Ember.Object.extend({ say: function(thing) { alert(thing); } }); var

    person = App.Person.create(); person.say("Hello Joe."); Friday, November 9, 12
  2. App.Editable = Ember.Mixin.create({ edit: function() { this.set('isEditing', true); }, isEditing:

    false }); App.CommentView = Ember.View.extend( App.Editable, { template: Ember.Handlebars.compile('...') }); Friday, November 9, 12
  3. App.president = Ember.Object.create({ firstName: "Barack", lastName: "Obama", fullName: function() {

    return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') }); App.president.get('fullName'); Friday, November 9, 12
  4. App.president = Ember.Object.create({ firstName: "Barack", lastName: "Obama", fullName: function() {

    return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') }); App.president.get('fullName'); Friday, November 9, 12
  5. App.president = Ember.Object.create({ firstName: "George W.", lastName: "Bush", fullName: function()

    { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') }); App.president.set('firstName', 'Barack'); App.president.set('lastName', 'Obama'); Friday, November 9, 12
  6. <div class="navbar" style="margin-bottom:0"> <div class="navbar-inner"> <a class="brand" href="#">GiddyUp</a> {{outlet projects}}

    </div> </div> {{outlet scorecards}} {{outlet testResults}} {{outlet scorecard}} Friday, November 9, 12
  7. projects: Ember.Route.extend({ route: '/projects', // next slide index: Ember.Route.extend({ route:

    '/' }), show: Ember.Route.extend({ route: '/:project_id' }); }); Friday, November 9, 12
  8. projects: Ember.Route.extend({ route: '/projects', index: Ember.Route.extend({ route: '/' }), show:

    Ember.Route.extend({ route: '/:project_id' }); }); /projects/ Friday, November 9, 12
  9. projects: Ember.Route.extend({ route: '/projects', index: Ember.Route.extend({ route: '/' }), show:

    Ember.Route.extend({ route: '/:project_id' }) }); /projects/:project_id Friday, November 9, 12
  10. projects: Ember.Route.extend({ route: '/projects', index: Ember.Route.extend({ route: '/' }), show:

    Ember.Route.extend({ route: '/:project_id' }) }); /projects/:project_id Friday, November 9, 12
  11. App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'), birthday: DS.attr('date'), children:

    DS.hasMany('App.Child'), fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') }); var person = App.Person.find(1); Friday, November 9, 12