- In target Stimulus Controller
connect() {
this.element[this.identifier] = this
}or if name have special symbol (like auto_search_controller.js -> auto-search)
connect() {
this.element[ (str => { return str
.split('--')
.slice(-1)[0]
.split(/[-_]/)
.map(w => w.replace(/./, m => m.toUpperCase()))
.join('')
.replace(/^\w/, c => c.toLowerCase())
}
)(this.identifier)
] = this
}to call function from this controller
document.querySelector("#filters-price-section").priceSelect.fullPriceRangeReset()where
document.querySelector("#filters-price-section") // target DOM element ths controller namefullPriceRangeReset() // function in this Stimulus controller