Backbone.js Application Walkthrough Part 2: Views and Templates – Video Tutorial
We’re moving right along in our video series of tutorials walking you through the process of writing a Backbone.js application. Today we cover the views and embedded templates. There are a number of views here, all pulling from the same models and collections of wine. You’ll see each view, what it’s for, and how it works its magic. Click on through for this long look at Backbone.js views and templates.
Before you watch the video, there a few things I discovered while recording and after recording that I want to bring to your attention. First off, I realized that I forgot to increase the font size of the editor so that it could be more easily seen on small screens, so you’ll definitely want to watch this in full screen on a non-mobile device. Next, there was a line of code that was used a couple times in wine-list.js that I decided to refactor into its own function. Finally, as I mention in the video $(this.el) can be swapped out with this.$el, which is faster because it is already cached. You can see these changes represented in the code given below the video.
Just as a note, after I’m done with this whole project, I will be placing all the code up on GitHub for everyone to download and view.
<divid="content"> <h2>Welcome to Backbone Cellar</h2> <p>This is a sample application designed to teach people with the basic knowledge of Backbone.js how to use it in a real application.</p> </div>
I hope you all are learning. I know this isn’t exactly the way that someone would proceed through making a web app, but this is a logical way of showing things to you – though, not the only logical way. I’m looking forward to the next piece of this puzzle, as I hope you are also. God bless and Happy Coding!
Joe Zimmerman has been doing web development ever since he found an HTML book on his dad's shelf when he was 12. Since then, JavaScript has grown in popularity and he has become passionate about it. He also loves to teach others though his blog and otherpopularblogs. When he's not writing code, he's spending time with his wife and children and leading them in God's Word.