When the data arrives directly, the table is filled in, and I cannot tell you that if "A" arrives it is checked and if "D" arrives, no.
re(ref: getrefactormodel, contador:number){
let datos= this.fb.group({
word_to_rename: [ref.word_to_rename, Validators.required],
renowned_word: [ref.renowned_word, Validators.required],
name:[ref.name, Validators.required],
id:[ref.id, Validators.required],
activecheck:[ref.activecheck, Validators.required]
});
this.refactorFormGroupItemsArray.insert(contador,datos);
}
Like there is some way to put in the input that if value is A be checked if it is D no.
<input type="checkbox" formControlName="activecheck" value="D" />
checkbox is true/false value even you have set as string when you change it again the value will be either false or true.
re(ref: getrefactormodel, contador:number){
let datos= this.fb.group({
word_to_rename: [ref.word_to_rename, Validators.required],
renowned_word: [ref.renowned_word, Validators.required],
name:[ref.name, Validators.required],
id:[ref.id, Validators.required],
activecheck:[ref.activecheck == 'D' ? true : false , Validators.required]
});
this.refactorFormGroupItemsArray.insert(contador,datos);
}
demo 🚀
some angular component libraries has a components like checkbox the behave the way you want I been use primeng check their component here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With