Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, Input} from '@angular/core'
- import { Hero } from './hero'
- @Component({
- selector: 'my-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>
- `
- })
- @Component({
- selector: 'my-hero-detail-min',
- template: `
- <div *ngIf="hero">
- </label>{{hero.id}}</label>
- </div>
- `
- })
- export class HeroDetailComponent {
- @Input()
- hero: Hero;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement