ampersand-array-input-view
Version:
A view module for intelligently rendering and validating inputs that should produce an array of values. Works well with ampersand-form-view.
22 lines (20 loc) • 523 B
JavaScript
var InputView = require('ampersand-input-view');
var _ = require('underscore');
module.exports = InputView.extend({
bindings: _.extend({
'removable': {
type: 'toggle',
hook: 'remove-field'
}
}, InputView.prototype.bindings),
props: {
removable: 'boolean',
template: ['string']
},
events: {
'click [data-hook~=remove-field]': 'handleRemoveClick'
},
handleRemoveClick: function () {
this.parent.removeField(this);
}
});