|
|
|
|
|
by johnzabroski
4368 days ago
|
|
Also, why does your ampersand-forms code return string objects for error messages? Seems very limiting, and a pain in the butt to extend. If you have a getErrorMessage() method, why aren't you returning an ErrorMessage object, which clients can then extend with error types (hard/soft, failure/warning/information), etc. Technically, it should just be an Error object. This would then lend itself well to advanced composition, where I can write program interactions in terms of signals (raising Error objects and Success objects, etc.) Just some hopefully helpful advice. |
|
With regard to "pain in the butt to extend" you could use `extend` and just replace that one method that returns those string, right?
InputView.extend({ getErrorMessage: function () { // return error objects instead? } })
/me shrugs
Forms really are a pain, we tried to create a simple contract between a form-view an it's child field views that was as flexible as possible so you could easily write more input types.
More on that contract here: http://ampersandjs.com/learn/forms#form-input-view-conventio...
But hey, also... easy enough to use something else entirely, it's not like the forms stuff is bundled :)