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

Debugging Ember.js

tomdale
March 01, 2012

Debugging Ember.js

Ember.js introduces many powerful new concepts, such as bindings, computed properties, and auto-updating templates. Developers love the expressiveness, but if the magic stops working, new users may not know where to begin debugging. In this talk, learn some strategies from a grizzled veteran about how to best troubleshoot your app when it stops working how you'd expect.

tomdale

March 01, 2012
Tweet

More Decks by tomdale

Other Decks in Technology

Transcript

  1. ▪ Web Inspector ▪ JSHint ▪ Demo Tips & tricks

    for debugging JavaScript on the web. DEBUGGING JAVASCRIPT.
  2. // Why is this kicking // puppies?! if (shouldntBePossible) {

    this.kickPuppies(); } DEBUGGER STATEMENT. debugger;
  3. ▪ Namespaces ▪ Don’t fear the stack trace ▪ Understanding

    common errors ▪ Logging ▪ Advanced debug-foo Tips & tricks speci c to Ember.js apps. DEBUGGING EMBER.JS
  4. >> Core = Ember.Namespace.create(); >> Core.Person = Ember.Person.extend(); >> Core.Person.toString();

    => Core.Person >> Core.Person.create().toString(); => <Core.Person:ember157> NAMESPACES.
  5. person = Ember.Object.create({ name: function() { // Break whenever name

    is // get or set. debugger; }.property() }); OVERRIDE PROPERTIES.
  6. Ember.View.reopen({ $: function() { if (window.billy) { debugger; } return

    this._super.apply(this, arguments); } }); WINDOW.BILLY
  7. ▪ Creating reduced test cases with jsFiddle ▪ Running and

    writing unit tests ▪ Better asserts Making Ember.js easier for you and others. HELP US HELP YOU