Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine
Next Chapter

Challenge #1 of 1


Q: 

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?

userVoice