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

462
Views
TS7006: Parameter 'event' implicitly has an 'any' type

In angular,

This is script

<button (click)="onClick($event)"> Greet </button>
     <button (click)="greeting='welcome' "> Greet </button> 
     {{greeting}}

This is event Logic

public greeting =""; 
 onClick(event) {
    console.log(event);
   this.greeting ='welcome';
  }
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Some alternatives you can use:

onClick(event: Event) {}

onClick(event: MouseEvent) {}

Also, if you are not using the parameter event for anything, you can remove it.

onClick() { ... }
about 4 years ago · Juan Pablo Isaza Report

0

Reason: If you have any chance to use Angular in previous versions when you create a new project you might see some question like this. And this question is very important. enter image description here

Fix: You can either follow the stricter type checking rule or manually switch the stricter type checking to false. It worked for me. enter image description here

about 4 years ago · Juan Pablo Isaza Report

0

On click of that button on console, we can see PoinerEvent { isTrusted": true }

So in addition to MouseEvent or Event you can also use:

onClick(event: PointerEvent) {}

Check the docs at PointerEvent MDN. "This interface inherits properties from MouseEvent and Event."

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!