Complete the code to import the Stimulus library using import maps in Rails 7+.
import { Application } from "@hotwired/[1]"
The Stimulus library is imported from "@hotwired/stimulus" using import maps in Rails 7+.
Complete the code to start the Stimulus application after importing it.
const application = [1]()You create a new Stimulus application by calling the imported 'Application' as a function.
Fix the error in the import map tag in Rails HTML to include the correct attribute.
<%= javascript_importmap_tags [1] %>The 'javascript_importmap_tags' helper accepts the option 'defer: true' to defer script loading properly.
Fill both blanks to register a Stimulus controller named 'hello_controller' in the application.
import HelloController from "./controllers/[1]" application.[2]("hello", HelloController)
You import the controller file 'hello_controller' and register it with the application using 'register'.
Fill the blank to define an import map pin for 'chart.js' with preload in config/importmap.rb.
pin "chart.js", to: "chart.umd.js", preload: [1]
To pin 'chart.js' with preload, set preload: true in importmap config.