Check out a free preview of the full Angular Core course:
The "Generate Modules" Lesson is part of the full, Angular Core course featured in this preview video. Here's what you'd learn in this lesson:

Lukas generates the projects, and customers modules, then demonstrates how to incorporate the standalone modules into the application.

Get Unlimited Access Now

Transcript from the "Generate Modules" Lesson

[00:00:00]
>> Speaker 1: Let's do the feature that we're going to be kind of focusing on, at least for the first part of this workshop, ng g m. We're gonna call this projects, also with routing.
>> Speaker 1: Go ahead and run that. And then we'll also do the projects component.
>> Speaker 1: And let's go ahead and do one more.

[00:00:25] And so this one's a bit of a toss-up, we'll see how far we get, but customers, same thing. It's nice to at least have these for a placeholder.
>> Speaker 1: ng g c customers.
>> Speaker 1: There we go. And so if we look over here,
>> Speaker 1: That in our app, we now have customers, home, and projects.

[00:00:56] So very quickly we're starting to just spin this up, and things are happening. And if you look in the app module, you'll notice that, well this isn't, so what I need to do is. Right now we have the material module, but what we need to do is, because we generate these features as stand alone modules, how do we get these into our application?

[00:01:26] So if we go into our code, and so let's just do home real quick. We have our home module, and so this is going to hold everything that has to do with home. So if we go into Our AppModule will just go down here and we'll just import this in.

[00:01:48] So HomeModule, there we go. And you'll notice that it's imported. So we now have the AppComponent and our HomeModule. And we can do this as well for our ProjectsModule, so we'll just add these all in.
>> Speaker 1: And our CustomersModule.
>> Speaker 1: And if we go in our HomeModule,
>> Speaker 1: We'll see that our HomeComponent.

[00:02:28] So let's what happens if we go into,
>> Speaker 1: I'll just take this.
>> Speaker 1: We'll go app. For our home component, let's just make sure my selector's correct at home. There we go. Let me just double check and make sure this compiled. So far so good. And let's refresh this and see, I might have thrown in an error.

[00:03:17] App home is not in your element, so let's try this, so Exports,
>> Speaker 1: HomeComponent, so I think we're back to kind of our material kind of trick here. So let's just take this out.