From the course: Learning Backbone.js

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Adding properties to the model

Adding properties to the model - Backbone.js Tutorial

From the course: Learning Backbone.js

Start my 1-month free trial

Adding properties to the model

In backbone, models to our webs applications data. When database developers can configure all their data in the database. That process is traditionally referred to as, modeling the data. Backbone models take inspiration from that process. Models are the centerpiece, backbone component in a web app, when compared to the other components. Because without data, our app would really have nothing to do. In this exercise, we're going to start building our model for our flower web app. We're going to create a model first. Then create instances of it. We are going to load this data onto a webpage eventually, but for now we'll be using google chrome's JavaScript console, to see how they're structured. So, I've got the file opened that I'm going to be working with called singleflowermodel.js. And then I'm going to open the snippets.txt file that's in my 02 folder right here. And I'm going to select and copy the code from lines ten to line 20, highlight it, copy it, and I'm going to paste it…

Contents