feat: Traduction des 80% restants de la page 'Custom Elements', + exercice & solution by vincent-clipet · Pull Request #572 · javascript-tutorial/fr.javascript.info
@@ -1,14 +1,14 @@
# Live timer element
We already have `<time-formatted>` element to show a nicely formatted time. Nous avons déjà un élément `<time-formatted>` pour afficher l'heure proprement.
Create `<live-timer>` element to show the current time: 1. It should use `<time-formatted>` internally, not duplicate its functionality. 2. Ticks (updates) every second. 3. For every tick, a custom event named `tick` should be generated, with the current date in `event.detail` (see chapter <info:dispatch-events>). Créez l'élément `<live-timer>` pour afficher l'heure actuelle: 1. Il doit réutiliser `<time-formatted>` en interne, pas dupliquer ses fonctionnalités. 2. Tick (mise à jour) toutes les secondes. 3. Pour chaque tick, un évènement personnalisé appelé `tick` devrait être généré, avec la date/heure actuelle accessible via `event.detail` (Voir le chapitre <info:dispatch-events>).
Usage: Utilisation:
```html <live-timer id="elem"></live-timer>Expand All
@@ -18,6 +18,6 @@ Usage:
</script>
```
Demo: Démo:
[iframe src="solution" height=40]
# Live timer element
We already have `<time-formatted>` element to show a nicely formatted time. Nous avons déjà un élément `<time-formatted>` pour afficher l'heure proprement.
Create `<live-timer>` element to show the current time: 1. It should use `<time-formatted>` internally, not duplicate its functionality. 2. Ticks (updates) every second. 3. For every tick, a custom event named `tick` should be generated, with the current date in `event.detail` (see chapter <info:dispatch-events>). Créez l'élément `<live-timer>` pour afficher l'heure actuelle: 1. Il doit réutiliser `<time-formatted>` en interne, pas dupliquer ses fonctionnalités. 2. Tick (mise à jour) toutes les secondes. 3. Pour chaque tick, un évènement personnalisé appelé `tick` devrait être généré, avec la date/heure actuelle accessible via `event.detail` (Voir le chapitre <info:dispatch-events>).
Usage: Utilisation:
```html <live-timer id="elem"></live-timer>
Demo: Démo:
[iframe src="solution" height=40]