Skip to content

Instantly share code, notes, and snippets.

@AmilKey
Created September 29, 2015 16:48
Show Gist options
  • Select an option

  • Save AmilKey/4aaf31b0ee7e4d9f39d0 to your computer and use it in GitHub Desktop.

Select an option

Save AmilKey/4aaf31b0ee7e4d9f39d0 to your computer and use it in GitHub Desktop.
ember 2.0 forms
amilkey [7:35 PM]
@ everyone what you use for forms?
i looked at ember addons that work with Ember 2.0 and didn't find anything
pixelhandler [7:36 PM]
@amilkey: I use a component for the form and have status for editing and previewing and sometimes use the buffered proxy addon to delay changes to the model
pixelhandler [7:39 PM]
and use a flag for new too, when previewing I make the inputs disabled
pixelhandler [7:39 PM]
my opinion is that I like to update each edit after the user leaves the field so I only use a save button for new records
samselikoff [7:40 PM]
ive also used buffered proxy, though these days i like subclassing the model and making a `draftable` version
samselikoff [7:40 PM]
which is nice because then you get all the computed properties, in case you want to use those in a form
pixelhandler [7:41 PM]
I use both the model and the buffered version in the form, e.g. I don’t buffer changes to relationships via form edits I like those to happen immediately
amilkey [7:43 PM]
@samselikoff: @pixelhandler do you have gist on github for example?
pixelhandler [7:45 PM]
@amilkey: yeah here is a test project I use that has the form editing (not the relationship editing) that I mentioned with buffered proxy. https://github.com/pixelhandler/jr-test/blob/master/app/components/form-post.js https://github.com/pixelhandler/jr-test/blob/master/app/templates/components/form-post.hbs (edited)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment