From the course: Learning Backbone.js

Unlock the full course today

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

Challenge: Create a new model and watch when it changes

Challenge: Create a new model and watch when it changes - Backbone.js Tutorial

From the course: Learning Backbone.js

Start my 1-month free trial

Challenge: Create a new model and watch when it changes

[SOUND] Now, it's time to test what we've learned so far with a challenge, where you create some new model instances, a new collection, and watch for changes. You should create two new instances, based on the app.singleFlower model. You should create one called Tantalizing Tulips and another one called Fleur-de-lis. Each should have a price and color, and these values can be anything that you want them to be. And both should be assigned to a collection you create called EuropeanFlower. Next, I want you to change the Tantalizing Tulips' properties by giving it a new key value pair, where its key is called originCountry and its value is called Holland. Now, you want two console messages to appear in your web browser console. One that appears any time an instance changes and another one detailing the structure of the European flower collection. This challenge should take you about fifteen minutes and the files for the challenge are in the 0202-04 folder, and there are probably a few ways…

Contents