HTML
<!-- HTML anywhere --> <div data-atv-controller="hello"> <input data-atv-hello-target="name" type="text"> <button data-atv-hello-action="click->greet"> Greet </button> <span data-atv-hello-target="output"> </span> </div>
JavaScript
// app/javascripts/controllers/hello_atv.js function activate(targets) { return { greet: function() { targets.output.textContent = `Hello, ${targets.name.value}!`; } }; } export { activate };
Try it:
ATV is working to provide the same functionality as Stimulus.js, but with a simpler way of
defining your controllers.
See more examples.
If you are interested in helping the effort please join the discussion board on Github.
See more examples.
If you are interested in helping the effort please join the discussion board on Github.