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

146
Views
Call method as user paste in textbox
<textarea name="" id="" #text cols="30" (keydown)="Counter()" (change)="Counter()" rows="8" [(ngModel)]="user_text" placeholder="Please write"></textarea>

I have this textarea i want to call counter method when the user types in the textarea

 wordCounter() {
    this.count= this.user_text.trim().split(/\s+/).length;
 }

this is working but when i paste anything in textarea then value not gets updated and value only gets updated when i click on window. I want count should get updated as soon user paste anything in textarea

Thanks

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

0

Since your using Angular I would recommend using the formbuilder instead of NgModule and subscribe to the events there.

Checkout an example here: https://stackblitz.com/edit/angular-ivy-rwjwd5?file=src/app/app.component.ts

and Documentation here: https://angular.io/api/forms/FormBuilder

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!