Closed
Description
Sometimes you'll want to attach a stimulus controller to the root element of your live controller. Currently, you might try this:
<div
{{ attributes.defaults({ 'data-controller: 'foo'})
>
But, I don't think that works, as I think we're always setting data-controller
to live
:
Also, that's a pretty ugly syntax, especially if you need to pass in some values 😱 .
What about one of the following:
<div
{{ attributes.stimulusController('foo', {}) }]
{{ stimulus_controller('foo', {})|attributes }}
Is this one even possible? Would `|merge` instead of "+" work?
{{ stimulus_controller('foo', {}) + attributes }}
>
stimulus_controller
returns a StimulusControllersDto which has a toArray()
method.