In the project I'm working on, there is a verification page for e-mail addresses. When new users register, they are sent an e-mail with a link to verify their e-mail. If the link is not clicked within a certain time frame, a button appears on the page that they must click in order to receive a new e-mail. I want this button to be disabled permanently after it is clicked, even if the user returns to the original link.
I attempted to add the [disabled] property to the button and set it to true after it is clicked. However, I noticed that when the page is refreshed or revisited, the button is not actually disabled.
Here is the HTML code I have so far:
<button type="button"
class="btn btn-primary"
[disabled]="clicked"
(click)=resendEmail()>
Resend Verification E-mail
</button>
And in my TypeScript file:
resendEmail() {
this.clicked = true;
}