0

I require to show a value i the title bar. but the data in the *ngFor loop. how get that?

here is my code :

    <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>
3gwebtrain
  • 14,377
  • 24
  • 102
  • 222
  • You have multiple countries and you want to show `countryCode` of one of them. Which one? – Roberto Zvjerković May 14 '18 at 13:16
  • actually I require to show the `span` value in to `h4` element. forgot the rest. as well i need to hide the `span` since i show that in `h4` – 3gwebtrain May 14 '18 at 13:17
  • Some one should not just put down vote. should post the wrong things or challenges on the requirement. – 3gwebtrain May 14 '18 at 13:31
  • I think answer of @Sasxa in the below link may help you https://stackoverflow.com/a/35826628/8082572 – Chinna M May 14 '18 at 14:23
  • It's not clear what's your problem and what's the expected behavior. What exactly do you need to show in the

    tag? What happens when you click a country in the list?

    – hiper2d May 14 '18 at 14:30

0 Answers0