import { ProductListComponent } from './product-list/product-list.component';
import { ProductDetailsComponent } from './product-details/product-details.component';
import { ProductAlertsComponent } from './product-alerts/product-alerts.component';
+import { CartComponent } from './cart/cart.component';
@NgModule({
declarations: [
TopBarComponent,
ProductListComponent,
ProductDetailsComponent,
- ProductAlertsComponent
+ ProductAlertsComponent,
+ CartComponent
],
imports: [
BrowserModule,
RouterModule.forRoot([
{ path: '', component: ProductListComponent },
- { path: 'products/:productId', component: ProductDetailsComponent }
+ { path: 'products/:productId', component: ProductDetailsComponent },
+ { path: 'cart', component: CartComponent }
])
],
providers: [],
--- /dev/null
+<p>cart works!</p>
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CartComponent } from './cart.component';
+
+describe('CartComponent', () => {
+ let component: CartComponent;
+ let fixture: ComponentFixture<CartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-cart',
+ templateUrl: './cart.component.html',
+ styleUrls: ['./cart.component.css']
+})
+export class CartComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}