Connect An Event To a Stimulus Controller Action

InstructorDamon Bauer

Share this video with your friends

Send Tweet

In this lesson, we'll explore what it takes to connect a user input event to a Stimulus controller method, using a Stimulus action. In doing so, we'll be able to filter down a collection of DOM elements, grouped by a Stimulus target, to show relevant filtered content to the user as they type.

We'll also learn about some incredibly useful JavaScript features, including Array.from, String.includes, and a little known feature of classList.toggle. Once you get down to the actual Stimulus controller code, it's "just JavaScript"!