BETTERZON-42: Restructuring, creating necessary components, design of Product detail component

This commit is contained in:
2020-12-09 07:51:08 +01:00
34 changed files with 508 additions and 40 deletions
@@ -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 {
}
}