DaQuirm/nexus

View on GitHub
demos/input/input-template.js

Summary

Maintainability
A
0 mins
Test Coverage
function Input(property, converter, backConverter, attrs) {
    var inputElement = nxt.Element('input',
        attrs,
        nxt.Binding(property, function(value) {
            return nxt.Attr('value', converter(value));
        }),
        nxt.Event('input', function() {
            property.value = backConverter(inputElement.node.value);
        })
    );
    return inputElement;
}