diff --git a/src/app/pages/bikes/bikes.component.html b/src/app/pages/bikes/bikes.component.html new file mode 100644 index 0000000..5dd51de --- /dev/null +++ b/src/app/pages/bikes/bikes.component.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
No. {{element.position}} Name {{element.name}} Weight + + Symbol {{element.symbol}}
diff --git a/src/app/pages/bikes/bikes.component.scss b/src/app/pages/bikes/bikes.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/bikes/bikes.component.spec.ts b/src/app/pages/bikes/bikes.component.spec.ts new file mode 100644 index 0000000..5b919b7 --- /dev/null +++ b/src/app/pages/bikes/bikes.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BikesComponent } from './bikes.component'; + +describe('BikesComponent', () => { + let component: BikesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BikesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BikesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/bikes/bikes.component.ts b/src/app/pages/bikes/bikes.component.ts new file mode 100644 index 0000000..7042633 --- /dev/null +++ b/src/app/pages/bikes/bikes.component.ts @@ -0,0 +1,41 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-bikes', + templateUrl: './bikes.component.html', + styleUrls: ['./bikes.component.scss'] +}) +export class BikesComponent implements OnInit { + + displayedColumns: string[] = ['position', 'name', 'weight', 'symbol']; + dataSource = ELEMENT_DATA; + + constructor() { + } + + onTableInput(element) { + //element.weight += 1; + console.log(element); + } + + onFocus(event) { + console.log(event); + } + + ngOnInit(): void { + } + +} + +const ELEMENT_DATA = [ + {position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'}, + {position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'}, + {position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'}, + {position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'}, + {position: 5, name: 'Boron', weight: 10.811, symbol: 'B'}, + {position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'}, + {position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'}, + {position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'}, + {position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'}, + {position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'}, +];