diff options
Diffstat (limited to 'src/app/heroes')
-rw-r--r-- | src/app/heroes/heroes.component.html | 4 | ||||
-rw-r--r-- | src/app/heroes/heroes.component.scss | 0 | ||||
-rw-r--r-- | src/app/heroes/heroes.component.spec.ts | 25 | ||||
-rw-r--r-- | src/app/heroes/heroes.component.ts | 20 |
4 files changed, 49 insertions, 0 deletions
diff --git a/src/app/heroes/heroes.component.html b/src/app/heroes/heroes.component.html new file mode 100644 index 0000000..0bc287b --- /dev/null +++ b/src/app/heroes/heroes.component.html | |||
@@ -0,0 +1,4 @@ | |||
1 | {{hero.name | uppercase}} Details <br>id: {{hero.id}}<br>name: {{hero.name}} | ||
2 | <br> | ||
3 | <br> | ||
4 | <input [(ngModel)]="hero.name" placeholder="name"> | ||
diff --git a/src/app/heroes/heroes.component.scss b/src/app/heroes/heroes.component.scss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/app/heroes/heroes.component.scss | |||
diff --git a/src/app/heroes/heroes.component.spec.ts b/src/app/heroes/heroes.component.spec.ts new file mode 100644 index 0000000..66518e4 --- /dev/null +++ b/src/app/heroes/heroes.component.spec.ts | |||
@@ -0,0 +1,25 @@ | |||
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
2 | |||
3 | import { HeroesComponent } from './heroes.component'; | ||
4 | |||
5 | describe('HeroesComponent', () => { | ||
6 | let component: HeroesComponent; | ||
7 | let fixture: ComponentFixture<HeroesComponent>; | ||
8 | |||
9 | beforeEach(async(() => { | ||
10 | TestBed.configureTestingModule({ | ||
11 | declarations: [ HeroesComponent ] | ||
12 | }) | ||
13 | .compileComponents(); | ||
14 | })); | ||
15 | |||
16 | beforeEach(() => { | ||
17 | fixture = TestBed.createComponent(HeroesComponent); | ||
18 | component = fixture.componentInstance; | ||
19 | fixture.detectChanges(); | ||
20 | }); | ||
21 | |||
22 | it('should create', () => { | ||
23 | expect(component).toBeTruthy(); | ||
24 | }); | ||
25 | }); | ||
diff --git a/src/app/heroes/heroes.component.ts b/src/app/heroes/heroes.component.ts new file mode 100644 index 0000000..0f72ae9 --- /dev/null +++ b/src/app/heroes/heroes.component.ts | |||
@@ -0,0 +1,20 @@ | |||
1 | import { Component, OnInit } from '@angular/core'; | ||
2 | import { Hero } from '../hero'; | ||
3 | |||
4 | @Component({ | ||
5 | selector: 'app-heroes', | ||
6 | templateUrl: './heroes.component.html', | ||
7 | styleUrls: ['./heroes.component.scss'] | ||
8 | }) | ||
9 | export class HeroesComponent implements OnInit { | ||
10 | hero: Hero ={ | ||
11 | id: 1, | ||
12 | name: 'Windstorm' | ||
13 | }; | ||
14 | |||
15 | constructor() { } | ||
16 | |||
17 | ngOnInit() { | ||
18 | } | ||
19 | |||
20 | } | ||