We're going to refactor our entire about section to be it's own Angular NgModule.

The reason we do this is because we can lazy-load that entire section and only load it when our users want access to it. This keeps our app lean for our users.

app/about/about.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AboutComponent } from './about.component';
import { AboutUserComponent } from './about-user.component';
import { UserService } from '../shared/services/user.service';
import { aboutRouting } from './about.routing';

@NgModule({
  imports: [
    CommonModule,
    aboutRouting
  ],
  declarations: [
    AboutComponent,
    AboutUserComponent
  ],
  providers: [
    UserService
  ]
})
export class AboutModule {}

Chris Sevilleja

163 posts

Co-founder of Scotch.io. Slapping the keyboard until something good happens.