Function to format model properties. Returns decorator Object containing formatted properties.
Parameter | Type | Description |
---|---|---|
model | Object | Object containing properties to be formatted. |
formatters | Object | Object matching property names (keys) and formatter functions (values). Formatted values have the text "formatted" appended to their names. Unformatted values are retained in the object under their original names. |
clone | Object | Object whose properties are copied to model decorator object before applying the formatter functions. Optional. |
Example usage:
var obj = Mojo.Model.format(this.controller.model, this.controller.attributes.formatters);
0 Comments