Finally, the template for the show-gdp component will render the chart and show the country GDP data. The template looks as follows:
<div class="container">
<h2 id="page-heading">
<span> GDP data for country <b>{{currentCountry.name}}</b></span>
</h2>
<br/>
<div class="row">
<div class="col-4">
<dl class="row">
<dt class="col-sm-4">Code</dt>
<dd class="col-sm-8">{{currentCountry.code}}</dd>
<dt class="col-sm-4">Name</dt>
<dd class="col-sm-8">{{currentCountry.name}}</dd>
<dt class="col-sm-4">Continent</dt>
<dd class="col-sm-8">{{'gdpApp.Continent.' +
currentCountry.continent | translate }}</dd>
<dt class="col-sm-4">Region</dt>
<dd class="col-sm-8">{{currentCountry.region}}</dd>
<dt class="col-sm-4">Surface Area</dt>
<dd class="col-sm-8">{{currentCountry.surfaceArea}}</dd>
<dt class="col-sm-4"></dt>
<dd class="col-sm-8">
<div class="btn-group">
<button type="submit"
[routerLink]="['/countries']"
class="btn btn-info btn-sm">
<span class="d-none d-md-inline">Back</span>
</button>
</div>
</dd>
</dl>
</div>
<div class="col-8">
<div *ngIf="noDataAvailale">
GDP data for <b>{{currentCountry.name}}</b> is not available
</div>
<div *ngIf="chart">
<canvas id="canvas">{{ chart }}</canvas>
</div>
</div>
</div>
</div>
It shows a few details about the selected country, followed by a placeholder for the chart. The noDataAvailale variable is used to show a message, in the case that there is no GDP data available for the selected country. It is set in the show-gdp component while making the World Bank API call.