Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ember from 'ember';
- export default Ember.Controller.extend({
- appName: 'Ember Twiddle',
- newPost: Ember.computed(function() {
- return this.store.createRecord('post');
- }),
- posts: Ember.computed(function() {
- return this.store.peekAll('post');
- }),
- actions: {
- done() {
- this.set('newPost', this.store.createRecord('post'));
- },
- cancel() {
- this.get('newPost').rollbackAttributes();
- this.set('newPost', this.store.createRecord('post'));
- }
- }
- });
Add Comment
Please, Sign In to add comment