/Angular_Binding_UdemyExercice

Angular 4 -> Binding on Custom Properties and Events (Decorator @Input() & @Output())

Primary LanguageTypeScript

Exercice Angular Udemy

Working on :

  • Binding on Custom Properties -> Input()
  • Binding on Custom Events -> Ouput()

Exercice -> Bind it!

  1. Create three new components: GameControl, Odd and Even
  2. The GameControl Component should have buttons to start and stop the game
  3. When starting the game, an event (holding a incrementing number) should get emitted each second (ref = setInterval())
  4. The event should be listenable from outside the component
  5. When stopping the game, no more events should get emitted (clearInterval(ref))
  6. A new Odd component should get created for every odd number emitted, the same should happen for the Even Component (on even numbers)
  7. Simply output Odd - NUMBER or Even - NUMBER in the two components
  8. Style the element (e.g. paragraph) holding your output text differently in both components