소스 검색

toh-pt3

master
Nils Dittberner 6 년 전
부모
커밋
3ebe71f53b
6개의 변경된 파일56개의 추가작업 그리고 10개의 파일을 삭제
  1. +3
    -1
      src/app/app.module.ts
  2. +0
    -0
      src/app/hero-detail/hero-detail.component.css
  3. +9
    -0
      src/app/hero-detail/hero-detail.component.html
  4. +25
    -0
      src/app/hero-detail/hero-detail.component.spec.ts
  5. +18
    -0
      src/app/hero-detail/hero-detail.component.ts
  6. +1
    -9
      src/app/heroes/heroes.component.html

+ 3
- 1
src/app/app.module.ts 파일 보기

@@ -4,11 +4,13 @@ import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { HeroesComponent } from './heroes/heroes.component';
import {FormsModule} from '@angular/forms';
import { HeroDetailComponent } from './hero-detail/hero-detail.component';

@NgModule({
declarations: [
AppComponent,
HeroesComponent
HeroesComponent,
HeroDetailComponent
],
imports: [
BrowserModule,


+ 0
- 0
src/app/hero-detail/hero-detail.component.css 파일 보기


+ 9
- 0
src/app/hero-detail/hero-detail.component.html 파일 보기

@@ -0,0 +1,9 @@
<div *ngIf="hero">
<h2>{{hero.name | uppercase}} Details</h2>
<div><span>id: </span>{{hero.id}}</div>
<div>
<label>name:
<input [(ngModel)]="hero.name" placeholder="name"/>
</label>
</div>
</div>

+ 25
- 0
src/app/hero-detail/hero-detail.component.spec.ts 파일 보기

@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { HeroDetailComponent } from './hero-detail.component';

describe('HeroDetailComponent', () => {
let component: HeroDetailComponent;
let fixture: ComponentFixture<HeroDetailComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HeroDetailComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(HeroDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

+ 18
- 0
src/app/hero-detail/hero-detail.component.ts 파일 보기

@@ -0,0 +1,18 @@
import {Component, Input, OnInit} from '@angular/core';
import { Hero } from '../hero';

@Component({
selector: 'app-hero-detail',
templateUrl: './hero-detail.component.html',
styleUrls: ['./hero-detail.component.css']
})
export class HeroDetailComponent implements OnInit {

@Input() hero: Hero;

constructor() { }

ngOnInit() {
}

}

+ 1
- 9
src/app/heroes/heroes.component.html 파일 보기

@@ -7,12 +7,4 @@
</li>
</ul>

<div *ngIf="selectedHero">
<h2>{{selectedHero.name | uppercase}} Details</h2>
<div><span>id: </span>{{selectedHero.id}}</div>
<div>
<label>name:
<input [(ngModel)]="selectedHero.name" placeholder="name"/>
</label>
</div>
</div>
<app-hero-detail [hero]="selectedHero"></app-hero-detail>

불러오는 중...
취소
저장