import { NgModule } from '@angular/core' ; import { CommonModule } from '@angular/common' ; import { Routes , RouterModule } from '@angular/router' ; import { ReactiveFormsModule } from '@angular/forms' ; import { HttpClientModule } from '@angular/common/http' ; import * as fromComponents from './components' ; import * as fromContainers from './containers' ; import * as fromServices from './services' ; export const ROUTES = [ { path : '' , component : fromContainers . ProductsComponent , } , { path : ':id' , component : fromContainers . ProductItemComponent , } , { path : 'new' , component : fromContainers . ProductItemComponent , } , ] ; @ NgModule ( { imports : [ CommonModule , ReactiveFormsModule , HttpClientModule , RouterModule . forChild ( ROUTES ) , ] , providers : [ ... fromServices . services ] , declarations : [ ... fromContainers . containers , ... fromComponents . components ] , exports : [ ... fromContainers . containers , ... fromComponents . components ] , } ) export class ProductsModule { }