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

Ember Data

Ember Data

Paul Chavard

May 30, 2012
Tweet

More Decks by Paul Chavard

Other Decks in Programming

Transcript

  1. Ember Data

  2. Paul Chavard capitainetrain.com

  3. Capitaine Train recrute!

  4. ALPHA !

  5. DS.Store

  6. ✓ store = DS.Store.create() ✓ store.createRecord(App.Person) ✓ store.find(App.Person, 42) ✓

    store.findAll(App.Person) ✓ store.findQuery(App.Person, {name: ‘Paul’}) ✓ store.filter(App.Person, function(data) {})
  7. DS.Model

  8. ✓ App.Person = DS.Model.create() ✓ DS.attr(“string”) ✓ DS.attr(“number”) ✓ DS.attr(“boolean”)

    ✓ DS.attr(“date”)
  9. ✓ DS.hasMany(“App.Person”) ✓ DS.belongsTo(“App.Person”) ✓ DS.hasMany(“App.Person”, {embedded: true})

  10. ✓ record = App.Person.createRecord({name: “Paul”}) ✓ record.set(“name”, “Paul Chavard”) ✓

    record.incrementProperty(“age”) ✓ record.deleteRecord()
  11. DS.Transaction

  12. ✓ transaction = store.transaction() ✓ transaction.add(record) ✓ transaction.rollback() ✓ transaction.commit()

  13. DS.Adapter

  14. ✓ adapter.find(store, type, id) ✓ adapter.findAll(store, type) ✓ adapter.createRecord(store, type,

    record) ✓ adapter.updateRecord(store, type, record) ✓ adapter.deleteRecord(store, type, record)
  15. DS.RESTAdapter

  16. Active Model Serializers github.com/josevalim/active_model_serializers

  17. Demo gist.github.com/2835387 github.com/tchak/colors-demo colors-demo.herokuapp.com

  18. Ember Meetup www.meetup.com/EmberJS-Paris

  19. twitter @emberjs github @emberjs IRC #emberjs emberjs.org

  20. twitter @tchak13 github @tchak talks.tchak.net

  21. thanks ! questions ?