This course has been updated! We now recommend you take the Angular 9 Fundamentals course.

Check out a free preview of the full Build Web Apps with Angular 2 course:
The "Challenge 2" Lesson is part of the full, Build Web Apps with Angular 2 course featured in this preview video. Here's what you'd learn in this lesson:

In this challenge you will create a Widgets feature. You will make an ES6 class for the widgets component, import any necessary modules, decorate the component to use the widgets template, and display the widgets component in the home component.

Get Unlimited Access Now

Transcript from the "Challenge 2" Lesson

[00:00:00]
>> [MUSIC]

[00:00:04]
>> Lukas: So, what we are going to do is create a widgets feature. You're welcome to use any of the other features as an example. So, for instance you could reference home. They're fairly consistent. Other than experiments I tend to build out on that a little further. And, so create a widgets feature, that's going to include the file structure, the class for it.

[00:00:28] You can do your template inline or as a template URL. Your call, play around with both if you want, and then display your widgets component in the home component. Bonus, if you actually look at the routes, so there's a few things I'm gonna allow you to push yourself on, is you can create a simple route to navigate to that component, the widgets component directly.

[00:01:00] It's pretty easy to figure it out. And so if you want to add an additional button to the nav bar across the top to go to widgets, we're gonna do that anyways. But it wouldn't hurt to maybe get a head start on that, as well as, please write a widgets test.

[00:01:17] And, fairly straightforward but the big thing is I want you to create the widgets file structure, and the file, and then get that rendering in your home page.