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.

Understanding how route links work

Understanding how route links work - Backbone.js Tutorial

From the course: Learning Backbone.js

Start my 1-month free trial

Understanding how route links work

So with the routers, we're creating links to methods and treating the links as URLs. You may be thinking that at some point we have to create anchor tags to these links just so others can access them. But in fact, we've done this already. In this movie, we're going to review how this was accomplished and then finish building our route. But let me point out something first. So right now, we're looking at MyRouter.js file. The route on line 7 that's attached to the no copy method is just an empty set of quotes. This is how I attach the route to my homepage. So, if someone lands on my index.html page, the no copy method will be invoked. For the rest of the routes on lines 8 thru 10, these are the routes that I'm already linking to on my webpage. They were added while doing the views work in chapter 3, when I used views to render my model data. Let's recap this by first looking at flowerApp.js. When I created three model instances I gave each one a link property. Take note that this…

Contents