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

Lighting Up with Ember.js

Lighting Up with Ember.js

Introduction to Ember.js presented at Burlington JS. The code from the demo portion can be found at https://github.com/beerlington/ember-cats

Peter Brown

April 10, 2013
Tweet

More Decks by Peter Brown

Other Decks in Programming

Transcript

  1. BACKBONE.JS Backbone.js gives structure to web applications by providing models

    with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  2. EMBER.JS A framework for creating ambitious web applications Write dramatically

    less code Built for productivity Don't waste time making trivial choices
  3. RUBY ON RAILS Web development that doesn’t hurt Optimized for

    programmer happiness and sustainable productivity Convention over configuration
  4. “It is more important to reduce the effort of maintenance

    than it is to reduce the effort of implementation” Max Kanat-Alexander, Code Simplicity
  5. ROUTER Manages the state of the application App.Router.map(function() { this.route("about",

    { path: "/about" }); this.route("favorites", { path: "/favs" }); }); URL Route
  6. ROUTE Customizing the behavior of a route App.IndexRoute = Ember.Route.extend({

    setupController: function(controller) { // Set the IndexController's `title` controller.set('title', "My App"); } });
  7. CONTROLLER Acts as a proxy to the model App.SongController =

    Ember.ObjectController.extend({ duration: function() { var duration = this.get('content.duration'), minutes = Math.floor(duration / 60), seconds = duration % 60; return [minutes, seconds].join(':'); }.property('content.duration') });
  8. MODEL Persisted objects App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'),

    birthday: DS.attr('date'), fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') });
  9. VIEW When you need more control var view = Ember.View.create({

    templateName: 'say-hello', name: "Bob" });