3 ms·
I don't understand the example. How does: // hello_controller.js import { Controller } from "stimulus" export default class extends Controller { gr
by Touche 9y ago
I don't understand the example. How does:
// hello_controller.js
import { Controller } from "stimulus"
export default class extends Controller {
greet() {
console.log(`Hello, ${this.name}!`)
}
get name() {
return this.targets.find("name").value
}
}
get connected to the <div data-controller="hello"> element? I would expect something like `stimulus.register("hello", HelloController)`...