When it sees a data-attribute method, Stimulus sets up a listener on the event which executes the named method on the controller when the event fires
I might be mistaken but it seems that data-attribute
should be data-action
, that would make more sense to me.