We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91480bf commit adeb7d9Copy full SHA for adeb7d9
packages/tel-frontend/src/tel/components/hello-world/hello-world.js
@@ -0,0 +1,25 @@
1
+// packages/tel-frontend/src/components/hello-world/hello-world.js
2
+
3
+/**
4
+ * Hello World component JS
5
+ * This is where you add interactive behaviour for your component.
6
+ *
7
+ * Example: Highlight the component when it is clicked.
8
+ */
9
10
+function HelloWorld($module) {
11
+ this.$module = $module;
12
+}
13
14
+HelloWorld.prototype.init = function () {
15
+ if (!this.$module) {
16
+ return;
17
+ }
18
19
+ // Example behaviour: toggle a highlight class on click
20
+ this.$module.addEventListener('click', () => {
21
+ this.$module.classList.toggle('hello-world--highlight');
22
+ });
23
+};
24
25
+export default HelloWorld;
0 commit comments