2021-09-26 14:41:38 -07:00
|
|
|
import { Controller } from "@hotwired/stimulus"
|
|
|
|
|
|
|
|
|
|
export default class extends Controller {
|
2023-01-11 22:19:23 -08:00
|
|
|
static targets = [ "name", "output" ]
|
|
|
|
|
|
2021-09-26 14:41:38 -07:00
|
|
|
connect() {
|
2023-01-11 22:19:23 -08:00
|
|
|
// this.element.textContent = "Hello World!"
|
|
|
|
|
console.log('Hello World hello_controller.js');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
greet() {
|
|
|
|
|
console.log('greet');
|
|
|
|
|
this.outputTarget.textContent =
|
|
|
|
|
`Hello, ${this.nameTarget.value}!`
|
2021-09-26 14:41:38 -07:00
|
|
|
}
|
|
|
|
|
}
|