This is more of an approach based question rather than a coding question. I have to create a form with 3 fields i.e Name, Description, and text
this is what my mod.ts looks like.
mod.ts
export interface Mod {
id: number,
name ? : string,
clauseList: Clause
}
export interface Clause {
cName ? : string,
cid ? : number,
description: string,
id ? : number,
text ? : Text
}
export interface Text {
cid: number
txt ? : string,
tid ? : number
}
My first question is should I go for template-driven forms or reactive forms for this project?
One of the requirements from the 3rd field is that every time the user hits enter, the tid should increment by 1 and whatever the user enters should be saved as a different formgroup. cid should be that of Clause object. for example :
txt = "hi",
tid =1,
cid = 1
after pressing enter
txt = "welcome to our shop",
tid = 2,
cid = same as above
Can anyone help me with this? For a better reference I will post another of my questions which kinda uses the same format, It might help you figure out this question better TypeScript for loop in a nested Array?
My contact lenses have dried up, I have been staring for too long at my screen. Please ask me for more clarification. May the force be with you.