Last active
December 17, 2015 04:18
-
-
Save Blackmist/5548924 to your computer and use it in GitHub Desktop.
newpost action controller
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
App.NewpostController = Ember.ObjectController.extend({ | |
title: '', | |
author: '', | |
body: '', | |
save: function() { | |
//create the post | |
console.log('title: '+this.get('title')); | |
//set fields back to empty so the form is cleared | |
//on next visit | |
this.set('title',''); | |
this.set('author',''); | |
this.set('body',''); | |
//transition back to posts | |
this.transitionToRoute('posts'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment