From f9d0f6c6d771dbf57843bdc6034b2a20dddb128a Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 23 Oct 2020 18:41:22 +0200 Subject: Add stimulus.js --- app/javascript/controllers/hello_controller.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/javascript/controllers/hello_controller.js (limited to 'app/javascript/controllers/hello_controller.js') 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: +// +//
+//

+//
+ +import { Controller } from "stimulus" + +export default class extends Controller { + static targets = [ "output" ] + + connect() { + this.outputTarget.textContent = 'Hello, Stimulus!' + } +} -- cgit v1.2.3