ember.js - Ember Transaction has no method add -


i'm attempting create ember transaction commit single model backend api.

coffeescript:

comic = app.comic.createrecord(title: @get('comictitle')) transaction = comic.get('store').transaction transaction.add(comic) transaction.commit() 

which gives javascript error:

uncaught typeerror: object function () {     return ds.transaction.create({ store: });   } has no method 'add' 

i've googled various different ways use ember transactions, i'm not sure i'm going wrong. i'm using latest version of ember data.

the coffeescript js translation may not happening correctly. try changing to

transaction = @get('store').transaction() 

i have found implicit method invocation in coffeescript trips in ember occasionally.


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

mouseevent - Catch mouse event on tree widget item in QTreeWidget -

Java JSoup error fetching URL -