From 407dfe41df942c3079dee61e1fc1ed6094bb3bd5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 21 Dec 2019 12:37:53 +0100 Subject: [PATCH] =?utf8?q?Cart-Component=20und=20zugeh=C3=B6riges=20Routin?= =?utf8?q?g=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 7 +++++-- src/app/cart/cart.component.css | 0 src/app/cart/cart.component.html | 1 + src/app/cart/cart.component.spec.ts | 25 +++++++++++++++++++++++++ src/app/cart/cart.component.ts | 15 +++++++++++++++ 5 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 src/app/cart/cart.component.css create mode 100644 src/app/cart/cart.component.html create mode 100644 src/app/cart/cart.component.spec.ts create mode 100644 src/app/cart/cart.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2bc4940..9fa5aad 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -7,6 +7,7 @@ import { TopBarComponent } from './top-bar/top-bar.component'; 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: [ @@ -14,13 +15,15 @@ import { ProductAlertsComponent } from './product-alerts/product-alerts.componen 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: [], diff --git a/src/app/cart/cart.component.css b/src/app/cart/cart.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/cart/cart.component.html b/src/app/cart/cart.component.html new file mode 100644 index 0000000..6bdabc8 --- /dev/null +++ b/src/app/cart/cart.component.html @@ -0,0 +1 @@ +

cart works!

diff --git a/src/app/cart/cart.component.spec.ts b/src/app/cart/cart.component.spec.ts new file mode 100644 index 0000000..3549561 --- /dev/null +++ b/src/app/cart/cart.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CartComponent } from './cart.component'; + +describe('CartComponent', () => { + let component: CartComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CartComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/cart/cart.component.ts b/src/app/cart/cart.component.ts new file mode 100644 index 0000000..c9276d4 --- /dev/null +++ b/src/app/cart/cart.component.ts @@ -0,0 +1,15 @@ +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() { + } + +} -- 2.20.1