aboutsummaryrefslogtreecommitdiff
path: root/app/javascript/controllers/hello_controller.js
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-23 18:41:22 +0200
committerhellekin <hellekin@cepheide.org>2020-10-23 18:41:22 +0200
commitf9d0f6c6d771dbf57843bdc6034b2a20dddb128a (patch)
tree6cac53679a5d0307a856a2aa3771299e4a60f2d0 /app/javascript/controllers/hello_controller.js
parent8970b8532c8d40786c3c00f9b77a5e74dfa53a2f (diff)
downloadincommon-map-f9d0f6c6d771dbf57843bdc6034b2a20dddb128a.tar.gz
Add stimulus.js
Diffstat (limited to 'app/javascript/controllers/hello_controller.js')
-rw-r--r--app/javascript/controllers/hello_controller.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/javascript/controllers/hello_controller.js b/app/javascript/controllers/hello_controller.js
new file mode 100644
index 0000000..28fdb13
--- /dev/null
+++ b/app/javascript/controllers/hello_controller.js
@@ -0,0 +1,18 @@
+// Visit The Stimulus Handbook for more details
+// https://stimulusjs.org/handbook/introduction
+//
+// This example controller works with specially annotated HTML like:
+//
+// <div data-controller="hello">
+// <h1 data-target="hello.output"></h1>
+// </div>
+
+import { Controller } from "stimulus"
+
+export default class extends Controller {
+ static targets = [ "output" ]
+
+ connect() {
+ this.outputTarget.textContent = 'Hello, Stimulus!'
+ }
+}