Skip to content

Instantly share code, notes, and snippets.

@serge-hulne
Last active October 28, 2020 17:33
Show Gist options
  • Select an option

  • Save serge-hulne/51f6fc92c4d93f381de9a4dc51837d1f to your computer and use it in GitHub Desktop.

Select an option

Save serge-hulne/51f6fc92c4d93f381de9a4dc51837d1f to your computer and use it in GitHub Desktop.
Form element binding
import { Input } from "axino/input";
import { Label } from "axino/label";
import { Div } from "axino/div";
import { eventsKeyBoard } from "axino/constants";
// Create a basic Div:
var d = new Div(null);
d.vertical();
d.appendToApp();
// Add a label to the Div:
var l = new Label(">");
l.appendTo(d);
// Add a line input:
var i = new Input("test");
i.appendTo(d);
i.onEvent(eventsKeyBoard.keyup, ()=> {
l.setText(i.getText());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment