When I click a button in my Angular page it should execute the a href
tag first and then execute the buttons onClick function.
<button (click)="invokeFun()"><a href="mylink.com?state=take-back-to-my-link.com">Link</a> </button>
But when I use this code, It takes me to the link and brings me back but onClick function is not invoked.
when I checked Chrome Inspector, I got this error:
Uncaught ReferenceError : invokeFun is not defined at HTMLButtonElement.onclick
However, when I use onClick separately, it works.