0

I have an angular project and I want to link a function from projects.component.ts, so when I make a click on a button on projects.component.html it calls that function. But when I click on the button.

I have this error message on chrome's console: Code

This is my html:

code from projects.component.html

This is my TS:

code from projects.component.ts

1
  • You need to swap onclick for (click).- angular.io/guide/user-input hope this helps. Commented Jun 30, 2020 at 15:33

1 Answer 1

1

Just change your HTML to the following :

<button type="button" (click)="infoTic.mirar()" class="btn btn-sm btn-outline-secondary">View</button>
Sign up to request clarification or add additional context in comments.

1 Comment

Please accept the answer by clicking on the ✔ icon below the question to close the loop. 🙂

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.