m.attrs.bidi
Bi-directional binding for Mithril!
As a custom attribute (requires custom attribute fork):
...Or as a component (ensures lexical reference):
Gimme!
# NPM npm install m.attrs.bidi --save # Bower bower install m.attrs.bidi --save
The plugin will attach itself as m.attrs.bidi and return / export / expose the same object as a module. The entity in question is both a component and a transformation function that works as a custom attribute.
// Node / Browserifyvar bidi = // ES6 // RequireJS // HTML<script src="https://cdn.rawgit.com/barneycarroll/m.attrs.bidi/master/bidi.js"></script><script> windowbidi = mattrsbidi;</script>
How
Dropdowns
Dropdowns will need their options passed in as normal.
Radio buttons
In the same way, radio buttons need to have values specified
Checkboxes
Custom attributes?
Custom attributes are a feature request for Mithril. You may be interested in the Github discussion, and in the fork of Mithril that implements the proposal.