Created
September 24, 2012 02:49
-
-
Save shwoodard/3773936 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
App.NewStoryView = Ember.View.extend | |
storyTitle: null | |
templateName: 'stories/new' | |
classNameBindings: ['hide'] | |
hide: false | |
storyTitleDidChange: (-> | |
console.log @toString() | |
console.log @get('storyTitle') | |
).observes('storyTitle') | |
clear: -> | |
@set('storyTitle', null) | |
createStory: -> | |
console.log @toString() | |
story = App.store.createRecord App.Story, | |
title: @get('storyTitle') | |
solution: @get('controller.content') | |
story.didCreate = => | |
@get('controller.content.stories').pushObject(story) | |
@clear() | |
App.store.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment