https://github.com/angular/angular
Raw File
Tip revision: 73261a8b7080b03caff1ee813f791bdb72668937 authored by Igor Minar on 21 March 2018, 04:37:12 UTC
docs: add changelog for 6.0.0-rc.0
Tip revision: 73261a8
app.component.ts
// #docregion
import { Component } from '@angular/core';

import { Hero, heroes } from './hero';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent {
  heroes = heroes;
  hero = this.heroes[0];

  condition = false;
  logs: string[] = [];
  showSad = true;
  status = 'ready';

  // #docregion trackByHero
  trackById(index: number, hero: Hero): number { return hero.id; }
  // #enddocregion trackByHero
}
back to top