You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #110 Adding a simpler syntax for single stimulus controller elements (weaverryan)
This PR was merged into the main branch.
Discussion
----------
Adding a simpler syntax for single stimulus controller elements
Having 1 controller per element is the main use-case. This makes that a bit nicer to do :).
```twig
<div {{ stimulus_controller('chart', { 'name': 'Likes', 'data': [1, 2, 3, 4] }) }}>
Hello
</div>
```
Also, this makes working with controllers that don't have any values (yet) MUCH nicer:
```twig
<!-- before -->
{{ stimulus_controller({ 'chart': {} }) }}
<!-- now -->
{{ stimulus_controller('chart') }}
```
Cheers!
Commits
-------
773ead9 adding a simpler syntax for single stimulus controller elements
0 commit comments