Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import { Component, Input} from '@angular/core'
  2. import { Hero } from './hero'
  3.  
  4. @Component({
  5. selector: 'my-hero-detail',
  6. template: `
  7. <div *ngIf="hero">
  8. <h2>{{hero.name}} details!</h2>
  9. <div><label>id: </label>{{hero.id}}</div>
  10. <div>
  11. <label>name: </label>
  12. <input [(ngModel)]="hero.name" placeholder="name"/>
  13. </div>
  14. </div>
  15. `
  16. })
  17. @Component({
  18. selector: 'my-hero-detail-min',
  19. template: `
  20. <div *ngIf="hero">
  21. </label>{{hero.id}}</label>
  22. </div>
  23. `
  24. })
  25. export class HeroDetailComponent {
  26. @Input()
  27. hero: Hero;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement