Join Ray Villalobos for an in-depth discussion in this video Using multiple subcomponents, part of Learn AngularJS 2: The Basics.
- View Offline
- [Voiceover] Creating sub-components is…something you'll have to do quite often,…and it gets a bit more complicated with the more…components we have on our application.…So let's see how adding a second sub-component…complicates things just a little bit.…Alright, so the first thing I want to do is…go ahead and create a new partial.…This is going to have the HTML for my new component.…So I'm going to call this artistdetails.html,…and this is just going to be some plain HTML.…
So these classes I am adding, like right here,…are just things that I've created in CSS.…Nothing that's Angular specific.…And here I'm going to be using interpolation to bring in…some of these variables from each user.…So this artist is going to be something that I'm going to…pass along to this artistdetails.html in my component.…And I'm going to go ahead and view this with…Soft Wrap so that you can see all of it.…
Most of the time I don't like to wrap things…because I think it makes the code look a bit more…disorganized, but it's a little bit easier to see…
In these tutorials, Ray Villalobos shows you how to start using AngularJS 2 in your own projects. He starts by defining what exactly Angular 2 is and how it differs from AngularJS 1. Then, once the basics are out of the way, he sets up the template that will drive the project and starts coding. Ray shows how to divide your project into modules, work with events, style content with CSS, and create components and subcomponents. Plus, find out how to change content dynamically using data pipes.
The template is included as a free download for all members.
- What is AngularJS 2?
- Setting up our template
- Creating a simple component
- Using multiple modules
- Displaying data in our templates
- Working with events
- Creating a subcomponent
- Filtering content through data pipes