An app built for TodoMVC
The code was written for an HTML5 compliant browser.
The todo list app is split into 3 major modules:
headermodule which lets users input new todo items
listmodule which renders and displays complete/incomplete tasks
footermodule that allows users to filter or clear tasks
todo behavior is used in the
list module to handle events for each individual todo task. This simplifies the
overall responsibilities of the module to rendering todos and marking them all as incomplete/complete.
While all modules are independent, each module talks to a service that maintains todo status. The
manages adding, removing, and marking tasks throughout the apps lifecycle. We could easily extend this
service to store todos via another service to the server or in HTML5 local storage.
router service uses HTML5 history to change urls dynamically and fire application messages.
statechanged message that is broadcast upon navigation is used by modules to update content.
Several messages are used between modules:
todoadded- Fired when a todo is added to the list
todoremoved- Fired when a todo is removed from the list
todostatuschanged- Fired when a todo changes from complete->incomplete and vice versa
Overall, message names should be understandable without explanation.