Two-way handlebars helper?


#1

I’m new to ember—loving it so far.

I’m using Ember-data. and I have an attribute that needs to contain some structured JSON. However, I want to use a textarea to edit this attribute. The textarea should not display the JSON “as JSON” but according to some other arbitrary criteria. For example, if I wanted to save CSV data (each line is an array of strings, or the like). I’ve built something similar in Angular utilizing the $parser and $formatter functions in a directive, but I don’t know how to tackle this in Ember.

Displaying the data seems to be the job of a handlebars helper—but what about re-parsing the textarea into JSON?

Surely there’s a good way to do this, I just have no clue where to start.

thanks