We're going to build a calendar in this chapter. You might think that's what we built in the last chapter, but this one is going to be different; it will be like a very boiled-down version of Google Calendar. We'll be able to view a month or a day at a time, and plan events that span a certain number of hours.
In this chapter, we will discuss the following ideas:
Better application component organization, with only one global variable for the whole application
Putting model functionality inside model methods
Using disposable models to encapsulate important information that we don't need to store on the server
Displaying a single model instance in multiple views
You can begin with the project template, as we have done before. However, we'll be using precompiled templates as we did in the previous chapter, and we'll also be separating our code into models.js
, views.js
, and router.js
. You may choose to copy the previous project and clear out the custom code instead...