mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-05-06 19:57:58 +00:00
BETTERZON-42: Restructuring, creating necessary components, design of Product detail component
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<app-header></app-header>
|
||||
<app-product-details [productId]="productId"></app-product-details>
|
||||
<app-footer></app-footer>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProductDetailPageComponent } from './product-detail-page.component';
|
||||
|
||||
describe('ProductDetailPageComponent', () => {
|
||||
let component: ProductDetailPageComponent;
|
||||
let fixture: ComponentFixture<ProductDetailPageComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ProductDetailPageComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProductDetailPageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-product-detail-page',
|
||||
templateUrl: './product-detail-page.component.html',
|
||||
styleUrls: ['./product-detail-page.component.css']
|
||||
})
|
||||
export class ProductDetailPageComponent implements OnInit {
|
||||
productId: string;
|
||||
|
||||
constructor(
|
||||
private router: Router
|
||||
) {
|
||||
this.productId = router.url.substr(9, router.url.length);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user