Hello.

I'm in the process of building a small form. I need a lot of elements that 
are very similar, so I want to use ngfor.
I need the Ng-model for further processing, so it has to be set in the loop.
But that's my problem.

*part of.ts*
 inputtexts = [
   {name: 'scenario_name', model: 'model.scenario_name'},
   
 ];

*part of .html*
<div *ngFor="let inputtext of inputtexts; let i = index;">
      {{inputtext.name}}
     
      <form [formGroup]="secondFormGroup_1" >
                 <input  placeholder="{{inputtext.name}}" type="text" id=
"{{inputtext.name}}"
                            name="{{inputtext.name}}" [(ngModel)]= "
{{inputtext.model}}" 
                             formControlName="{{inputtext.name}}"
                            required>
                         </form></div>
Code hier eingeben...


If I put the ng-model directly, everything works exactly as I would like:
[(ngModel)]= "model.scenario_name" 


So I wonder how I get the value Model from 'inputtexts' in this loop as NG 
model. 
Thanks :)

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to