How can I convert a string to a Typescript array?. Please help me.
Look at the code:
private validateEmptyOption(): any {
console.log("CHECKED")
let isValid = true;
this.currentForm.sections.forEach((section: Section) => {
section.fields.forEach((field: Field) => {
debugger
if (field.type === 'select') {
console.log(field)
const emptyOptionSections = JSON.parse(field.property).emptyOptionSections;
if ((emptyOptionSections !== undefined) && (emptyOptionSections == null)) {
alert('QAZWSX');
isValid = false;
}
}
return isValid;
});
});
}
This is my Result in console. I want do this convert to array and looping it.
Expected Result : There should be a validation message to inform that select controller cannot be empty
Actual Result : Form can save without any validation
