Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { Component } from '@angular/core';
import { TeamService } from './team.service';
import { Team } from './team';
@Component({
selector: 'app-root',
template: `
<h1>Teams</h1>
<ul>
<li *ngFor="let team of teams">{{team.name}}</li>
</ul>
`
})
export class AppComponent {
teams: Team[];
constructor(private teamService: TeamService) {
this.teamService.getTeams().subscribe(
teams => this.teams = teams
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.