Skip to content

Instantly share code, notes, and snippets.

@zeptobook
Created December 15, 2018 15:10
Show Gist options
  • Save zeptobook/f5ea5574d7f941aa33bf1f01dcbf10ef to your computer and use it in GitHub Desktop.
Save zeptobook/f5ea5574d7f941aa33bf1f01dcbf10ef to your computer and use it in GitHub Desktop.
fetch-data.component.html
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from the server.</p>
<p *ngIf="!forecasts"><em>Loading...</em></p>
<table class='table table-striped' *ngIf="forecasts">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let forecast of forecasts">
<td>{{ forecast.dateFormatted }}</td>
<td>{{ forecast.temperatureC }}</td>
<td>{{ forecast.temperatureF }}</td>
<td>{{ forecast.summary }}</td>
</tr>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment