Suppose we have a Stimulus controller called hello-controller.js
:
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
count = 0;
connect() {
this.count++;
this.element.textContent = 'Lucky number '+this.count;
}
}
And in your template, you have this:
<div>
<div data-controller="hello"></div>
<div data-controller="hello">Lucky Number</div>
</div>
What will the final page look like?