forked from SymfonyCasts/symfony-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddtransition-create-new-controller.diff
31 lines (31 loc) · 1.29 KB
/
addtransition-create-new-controller.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/assets/controllers/autocomplete-transition_controller.js b/assets/controllers/autocomplete-transition_controller.js
new file mode 100644
index 0000000..e54a46e
--- /dev/null
+++ b/assets/controllers/autocomplete-transition_controller.js
@@ -0,0 +1,7 @@
+import { Controller } from 'stimulus';
+
+export default class extends Controller {
+ connect() {
+ console.log('I want transitions!');
+ }
+}
diff --git a/templates/product/index.html.twig b/templates/product/index.html.twig
index 13840ad..e88a98e 100644
--- a/templates/product/index.html.twig
+++ b/templates/product/index.html.twig
@@ -38,8 +38,11 @@
<form>
<div
class="input-group"
- {{ stimulus_controller('autocomplete', {
- url: path('app_homepage', { preview: 1 })
+ {{ stimulus_controller({
+ 'autocomplete': {
+ url: path('app_homepage', { preview: 1 })
+ },
+ 'autocomplete-transition': {}
}) }}
>
<input