Cart-Component und zugehöriges Routing hinzugefügt
authorKai Moritz <kai@juplo.de>
Sat, 21 Dec 2019 11:37:53 +0000 (12:37 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 21 Dec 2019 11:37:53 +0000 (12:37 +0100)
src/app/app.module.ts
src/app/cart/cart.component.css [new file with mode: 0644]
src/app/cart/cart.component.html [new file with mode: 0644]
src/app/cart/cart.component.spec.ts [new file with mode: 0644]
src/app/cart/cart.component.ts [new file with mode: 0644]

index 2bc4940..9fa5aad 100644 (file)
@@ -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 (file)
index 0000000..e69de29
diff --git a/src/app/cart/cart.component.html b/src/app/cart/cart.component.html
new file mode 100644 (file)
index 0000000..6bdabc8
--- /dev/null
@@ -0,0 +1 @@
+<p>cart works!</p>
diff --git a/src/app/cart/cart.component.spec.ts b/src/app/cart/cart.component.spec.ts
new file mode 100644 (file)
index 0000000..3549561
--- /dev/null
@@ -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<CartComponent>;
+
+  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 (file)
index 0000000..c9276d4
--- /dev/null
@@ -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() {
+  }
+
+}