import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { CartComponent } from './cart/cart.component' ; const routes = [ { path : 'cart' , component : CartComponent } ] ; @ NgModule ( { imports : [ RouterModule . forChild ( routes ) ] , exports : [ RouterModule ] } ) export class CartRoutingModule { }