This course will be retired on July 21, 2017.
Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Views and Routes Challenge0:18 with Guil Hernandez
You're ready to start creating views and routes on your own! In this video, you'll create the templates and write the routes for the 'contact' and 'add-trails' views. This challenge is a great way to practice what you've learned so far.
When creating a child view, you define the parent template name in the front matter. For example:
--- name: featured url: /featured parent: home ---
This link will load the new child view when a user clicks on it:
<a ui-sref="featured">View the latest featured trails!</a>
The child view will load in a
You can also define the parent in the name variable like this:
--- name: home.featured url: /featured parent: home ---
Then, in the
ui-sref directive, add the parent view name in the value:
<a ui-sref="home.featured">View the latest featured trails!</a>
We've covered a lot of material so far, about views, and routing and
foundation for apps.
And you're ready to start creating views and routes on your own.
So, now, I'd like you to create the templates and write the routes, for
the contact and add view trails.
This challenge is a great way to practice, what you've learned so far.
And in the next video, I'll show you how I did it.
You need to sign up for Treehouse in order to download course files.Sign up