Incorporating Angular 4 into my project, I have a checkbox within my component's HTML template:
<input type="checkbox" (change)="canBeEditable($event)">
Inside the component's typescript file, I've implemented the following function to set the value to true.
toggleEditable() {
this.contentEditable = true;
}
The issue arises when I only want the value to be changed IF the checkbox IS checked.
To achieve this condition, the code snippet should resemble:
toggleEditable() {
if (checkbox is checked) {
this.contentEditable = true;
}
}
Seeking advice on the best way to implement this feature. How can this be accomplished?