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

JCI Slagelse

JCI Slagelse

Præsentation hos JCI i Slagelse.

Kasper Tidemann

April 16, 2014
Tweet

More Decks by Kasper Tidemann

Other Decks in Business

Transcript

  1. App.SomeModelController = Em.ArrayController.extend({ content: [], ! findRecord: function(id) { var

    self = this; return new Em.RSVP.Promise(function(resolve, reject) { var record = self.get(‘content’).findProperty(‘id’, id); ! if (record) { resolve(record); } else { (new PouchDB(‘someDatabase’)).get(id, function(err, doc) { if (err) { reject(error); } else { resolve(doc); } } } }); } });