I am trying to call an onclick function in a typescript written in Angular, however, I don't know why this error shows up.
Does anyone know how to solve this type of issue? Please help and give me some suggestion, thanks in advance!
.onclick
expects a function and it seems you are assigning it to a result of a function call.
Try
element.onclick = redirection;