Guest User

Untitled

a guest
Jan 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import Ember from 'ember';
  2.  
  3. export default Ember.Controller.extend({
  4. appName: 'Ember Twiddle',
  5. newPost: Ember.computed(function() {
  6. return this.store.createRecord('post');
  7. }),
  8. posts: Ember.computed(function() {
  9. return this.store.peekAll('post');
  10. }),
  11.  
  12. actions: {
  13. done() {
  14. this.set('newPost', this.store.createRecord('post'));
  15. },
  16. cancel() {
  17. this.get('newPost').rollbackAttributes();
  18. this.set('newPost', this.store.createRecord('post'));
  19. }
  20. }
  21.  
  22. });
Add Comment
Please, Sign In to add comment