Chapter 16. Controllers: linking models and views

This chapter covers

  • Acting on user input
  • Updating models in response to user actions
  • Passing updated models to views for display
  • Completing the console version of The Crypt

Part 2 of Get Programming with JavaScript has been about organizing your code. As your programs grow, that organization pays dividends, making it easier to focus on individual pieces, switch modules to alter functionality, and reuse code in multiple projects.

Breaking programs into modules encourages you to give each module a specific task. Chapters 14, 15, and 16 form a trilogy, with each chapter looking at a common task a module might perform. You met models in chapter 14 and views in chapter 15 and now you link ...

Get Get Programming with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.