Setting Up the Models

Learn how to set up the required models to implement the Header sub-application.

We'll cover the following

We’re going to manage the menu in our header with a sub-application. It will control application switching but will also track the currently active application so its menu entry can be highlighted. All these features will be handled by manipulating Backbone models and without HTML data- attribute complexities. Instead, we’ll use the composite view we’ve come to know and love.

Model set up

Our models will each represent one entry in our header menu, so we’ll need them to have name and url attributes to store the text we’ll display in the link and the link’s location, respectively. In addition to these attributes, we’ll also need to determine the active menu entry to highlight it. This is what we want to achieve:

Get hands-on with 1200+ tech skills courses.