I'm attempting to dynamically enable or disable an anchor element based on the user's role. So far, I've tried a few different methods:
document.getElementById('myBtn').disabled = true;
However, this returns an error: The property 'disabled' does not exist in type 'HTMLElement'.
After some research, I attempted the following:
(document.getElementById('myBtn') as any).disabled = true;
This doesn't throw any errors, but it also doesn't achieve the desired functionality.
Lastly, when trying to use the [disabled] property in Angular, I encountered the error: Can't bind to 'disabled' since it isn't a known property of 'a'.
Any suggestions for an alternative approach? Thanks in advance.