I want create an object using ember-data, but I don't want to save it until I call commit. How can I achieve this behavior?
You can use transaction's, defined transaction.js with corresponding tests in transaction_test.js.
transaction
See an example here:
App.store = DS.Store.create(...); App.User = DS.Model.extend({ name: DS.attr('string') }); var transaction = App.store.transaction(); transaction.createRecord(App.User, { name: 'tobias' }); App.store.commit(); // does not invoke commit transaction.commit(); // commit on store is invoked?
1.4m articles
1.4m replys
5 comments
57.0k users