Created
February 23, 2016 19:31
-
-
Save davidwallacejackson/32c12d32f16592fd5af2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller({ | |
//in this hypothetical example, there's no new browser until somebody | |
//asks for one | |
pendingNewBrowser: null, | |
actions: { | |
createNewBrowser() { | |
this.set('pendingNewBrowser', this.store.createRecord('browser'))); | |
}, | |
saveNewBrowser() { | |
this.get('pendingNewBrowser').save() | |
.then(() => this.set('pendingNewBrowser', null)); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment