Hi Basecamp people,
Thank you for this well-thought, another great JS library first of all.
I am currently using this in building one of our prototype and I was wondering if one element can have multiple data-target attributes.
E.g.,
.notifications data-target="notifications.panel, application.panel"
So that I can access this element from both NotificationsController and ApplicationController.
I know I can achieve my goal with other options (e.g., jQuery selectors), but just curious if there's better "stimulusy" way to achieve this.
Yep, just separate the target descriptors by a space in the data-target attribute:
<div class="notifications" data-target="notifications.panel application.panel">
Most helpful comment
Yep, just separate the target descriptors by a space in the
data-targetattribute: