By default the input fields are disabled, I should be enable the fields once the check box is checked. Any idea in angular 4 ?
Not sure if I understand the question here but make sure your check box is not bind a model which is already set to false (or default bool)
If you are simply trying to enable the check box when the checkbox is checked, you can do the following:
export class AppComponent {
isDisabled = true;
triggerSomeEvent() {
this.isDisabled = !this.isDisabled;
return;
}
}
and your HTML:
<input type="checkbox" name="myChk" id="myChk" (change)="triggerSomeEvent()" />
<input type="text" name="myTxt" id="myTxt" value="" [disabled]="isDisabled" />