Let' say that I have the following data model
export interface Employee {
name: string;
email: string;
age: number;
}
export interface Enterprise {
name: string;
employees: Employee[];
}
And the following is a signal Instance of the above data model:
enterpriseData = signal<Enterprise>({
name: '',
employees: []
});
And here's the form instance:
enterpriseForm = form(this.enterpriseData, (schemaPath) => {
required(schemaPath.name);
minLength(schemaPath.name, 2);
required(schemaPath.employees);
});
I would like to add validation to the name, the age and the email in every employee instance. How can I do that ?