Harmonious Development with Symfony 6
Stimulus: Sensible, Beautiful JavaScript
  Unlock this challenge
Login Register

Challenge 1 / 1

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?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.