javascript - How can I edit form data before setting a model property using Ember and ember-data? -



javascript - How can I edit form data before setting a model property using Ember and ember-data? -

i'm relatively new ember , trying figure out how can process info form input before saving ember model. (i'm using ember-data).

the field phone number, , want able strip out non-numeric characters before saving, 555-555-5555 or (555) 555-5555 etc. become 5555555555 when saved.

were in rails utilize before_save callback, best way in ember this?

you can utilize computed property, documented here http://emberjs.com/guides/object-model/computed-properties/

in case "real" property saved model, , bind computed property in template. when computed property is set can remove non-numeric characters , set "real" property.

javascript ember.js ember-data

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -