I want to check whether the input is empty.
- If not empty, enable the submit button.
- If empty, disable the submit button.
I tried (oninput) and (onchange), but they do not run.
<input type="password" [(ngModel)]="myPassword" (oninput)="checkPasswordEmpty()"/>
checkPasswordEmpty() {
console.log("checkPasswordEmpty runs");
if (this.myPassword) {
// enable the button
}
}