Click here to Skip to main content
15,888,109 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
problem
How to assign ng model input type text on header to ngfor element ?

I work on application work on angular 7 with asp.net core 2.1
on html component i have input type text and i need to assign it to ngfor element ?
but cannot do that
actually i need when user write or input type textbox branchcode as 2 then 2
will come to propery inside ngfor ?

What I have tried:

suppose i write on sales header input type text as 2
on salesorder.component.html
<div class="form-group">
                 <label>BranchCode</label>
                 <div class="input-group">
                   <input name="branchCode" #branchCode="ngModel" [(ngModel)]="api.SHeader.branchCode" class="form-control">
                 </div>
               </div>

Here on view i need to get 2 inside ngfor to element branchcode
<tr *ngFor="let item of api.Sfooter;let i = index;">

<td [(ngModel)]="api.SHeader.branchCode">{{item.branchCode}}</td>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900