hero-detail.component.ts
570 Bytes
import { Component,Input } from '@angular/core';
import {Hero } from '../models/hero';
@Component({
selector: 'hero-detail',
// template: `
// <div *ngIf="hero">
// <h2>{{hero.name}} details!</h2>
// <div><label>id: </label>{{hero.id}}</div>
// <div>
// <label>name: </label>
// <input [(ngModel)]="hero.name" placeholder="name"/>
// </div>
// </div>
// `,
templateUrl:'./hero-detail.component.html',
styleUrls:['./hero-detail.component.css']
})
export class HeroDetailComponent {
@Input() hero: Hero;
}