Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

712
Views
How show one element of the JSON on interpolation with Angular

How show one element of the JSON on interpolation with Angular

  public responseData:any;

  renderTokenCard(){
    this.mundipaggS.checkToken().subscribe((response:any)=> {
    console.log("success: ", JSON.stringify(response));
    this.cartS.tokenCard = response;
    this.responseData = response;
  }, );
    <div class="card-body">
    <i class="fab fa-cc-visa "></i>
       <div class="card-text">
         <b>{{responseData}}</b>
        </div
    </div>

The JSON

[{"id":1,"pessoa_id":75505,"created_at":"2022-02-01T17:42:46.000000Z","holder":"test ","validade":"2026-06-01","bandeira":"Mastercard"}]

How can I show the JSON holder property for example?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

sould be pretty simple if I understand you correctly:

this.responseData = response?[0];
<!-- the whole responseData -->
<b>{{responseData | json}}</b>


<!-- only the holder property -->
<b *ngIf="responseData">{{responseData.holder}}</b>
about 4 years ago · Juan Pablo Isaza Report

0

Using your example, you can use interpolation to display it in HTML.

<div class="card-body">
<i class="fab fa-cc-visa "></i>
//ngIf to check if responseData is not undefined, otherwise it will throw error
   <div class="card-text" *ngIf="responseData && responseData[0]">
     <b> {{responseData[0].holder }} </b>
    </div>
</div>

I see you are returning an array of objects, If you want to show multiple holders, you can use *ngFor to display them

<div class="card-body">
<i class="fab fa-cc-visa "></i>
   <div class="card-text" *ngFor="let data of responseData">
     <b> {{data.holder }} </b>
   </div>
</div>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!