From: Kai Moritz Date: Sat, 21 Dec 2019 11:37:53 +0000 (+0100) Subject: Cart-Component und zugehöriges Routing hinzugefügt X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=407dfe41df942c3079dee61e1fc1ed6094bb3bd5;p=examples%2Fangular-tutorial Cart-Component und zugehöriges Routing hinzugefügt --- 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() { + } + +}