6: Get Data from a Server
[examples/angular-tour-of-heroes] / src / app / heroes / heroes.component.html
1 <h2>My Heroes</h2>
2 <div>
3   <label>Hero name:
4     <input #heroName />
5   </label>
6   <!-- (click) passes input value to add() and then clears the input -->
7   <button (click)="add(heroName.value); heroName.value=''">
8     add
9   </button>
10 </div>
11 <ul class="heroes">
12   <li *ngFor="let hero of heroes">
13     <a routerLink="/detail/{{hero.id}}">
14       <span class="badge">{{hero.id}}</span> {{hero.name}}
15     </a>
16   </li>
17 </ul>