1. 3
    Extract a Value from an Stimulus Target Input
    2m 26s

Extract a Value from an Stimulus Target Input

InstructorIan Jones

Share this video with your friends

Send Tweet

We will use data-target to tell our controller which input element we are getting our value from.

We need to declare static targets = ['name'] in our controller to tell which element we are referencing. We then reference the value in the input element with this.nameTarget.value.