我要求在标题栏中显示一个值。但是*ngFor
循环中的数据。怎么做到的?
这是我的代码:
<h4 [ngClass]="{'drop-down' : country === countryCode }">{{countryCode}}</h4> //need to show here from under the loop
<ul class="country-list">
<li
*ngFor="let country of supportedCountries;"
(click)="updateCountry(country)">
<span [hidden]="country === countryCode">{{getPropCountry(country)}} {{country}} {{countryCode}}</span> //hiding
<ng-container *ngIf="country !== countryCode">{{getPropCountry(country)}} {{country}} {{countryCode}}</ng-container>
</li>
</ul>