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.
Loading model data on a webpage - Backbone.js Tutorial
From the course: Learning Backbone.js
Loading model data on a webpage
Okay, we've modeled our data. We've attached the data to a collection. We've made sure that the models and collections each have their own views. We've constructed page elements and we've created templates where we can place our data. We now need to add some data to this whole process in order to get some content to display on our web page. That's what we'll be doing in this movie inside of flowerApp.js. Now, in the last movie, we created a collection view called app.allFlowersView. It had a custom addFlower method that triggered most of the activity I outlined a few moments ago. It was a really, really powerful part of the collection view. All it needs to get going is some model data. And if we could find some data to plug into this view, we can get our data to display on a web page. We can do that with a few lines of code. Which I'll grab from snippets.txt. So go over there. And I'm going to highlight and copy lines 117 to 119, and go back to flowerApp.js and I'm going to place them…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Understanding views4m 13s
-
(Locked)
Adding properties to the model view2m
-
(Locked)
Creating and configuring templates7m 1s
-
(Locked)
Creating a collection view5m 43s
-
(Locked)
Loading model data on a webpage4m 38s
-
(Locked)
Challenge: Create a template2m 45s
-
(Locked)
Solution: Create a template2m 42s
-
(Locked)
-
-