Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

How to dynamically feed the this.validations_form?

$
0
0

@vanpevi wrote:

Hi,
I would like to create a form where the form fields are named in the ngOnInit based on data id that arrives in the same ngOnInit:
I would like to use the id in the names of the fields… but no idea how to achieve that?!
Thanks for reading,
V

ngOnInit() {

this.customers = [
{“id”:“1”,“name”:“name1”}
,{“id”:“2”,“name”:“name2”}
,{“id”:“3”,“name”:“name3”}
,{“id”:“4”,“name”:“name4”} ];
this.validations_form = this.formBuilder.group({
amountwater_amt1 : new FormControl(’’,Validators.required)
,amountwater_amt2 : new FormControl(’’,Validators.required)
,amountwater_amt3 : new FormControl(’’,Validators.required)
,amountwater_amt4 : new FormControl(’’,Validators.required)
,amountwine_amt1 : new FormControl(’’,Validators.required)
,amountwine_amt2 : new FormControl(’’,Validators.required)
,amountwine_amt3 : new FormControl(’’,Validators.required)
,amountwine_amt4 : new FormControl(’’,Validators.required)

});

}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>