Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.76 KB

user-story-4.md

File metadata and controls

43 lines (35 loc) · 1.76 KB

4. Show the list of all games (compact template)

Goal: As a user, I want to see the list of all games with an alternative compact template

Keywords: conditional template

  1. Display compact template in games list
  1. Switch between templates
  • In games.dart, add an observable field isCompact

    @observable bool isCompact = false;
  • Add a click handler on the toggle button to reverse the value of isCompact

    compact(Event e, var detail, Element target) => isCompact = !isCompact;
  • In games.html, use conditional templates to display the right template (Hints)

  1. Great! Needless to scroll down to see all your games
    x-games compact template

Hints:

Bonus:

  • Switch the toggle button class between icon-th-list and icon-th in function of isCompact value