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

231
Views
How to make a function update the value of angular inputs

When I select one of the cards in page below, I wish to have the value of the inputs updated with values from a json object

Example

The json:

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

The json value is on the variable "responseData"

renderTokenCard(){
this.mundipaggS.checkToken().subscribe((response:any)=> {
console.log( JSON.stringify(response));
this.cartS.tokenCard = response;
this.responseData = response;
console.log( JSON.parse(JSON.stringify(response))    );
}, );

the function that is linked to the select action:

SelecionarCartao(){

    this.mundipaggS.postToken(this.responseData)

    console.log(this.responseData)
}

I wanted to get the responseData value and make a post for the postToken

The HTML

<div class="form-group ">
                                    <label for="ncartao">Número do cartão <span class="text-danger"> *</span></label>
                                    <input name="card-number" maxlength="19"  #cardNumber formControlName="digiNumero" id="ncartao" type="text" class="form-control col-lg-6  " >
                                </div>

                                <div class="form-group">

                                    <label for="nomeimpresso">Nome <b>impresso</b> no cartão<span class="text-danger"> *</span></label>
                                    <input #nomeImpresso formControlName="digiNome"  name="holder-name" id="nomeimpresso" class="form-control col-lg-6" type="text" >
about 4 years ago · Juan Pablo Isaza
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!