ダイナミックテキストボックスを結合私はAngular2が
console.log(textboxvalue)
の値を収集するとき、私はそのようにテキストボックスの値とIDの両方に結合することができますどのようにこの
<ul>
<li *ngFor="let data of list">
//here bind a textbox to the id and get its value so something like
<input type="text" /> //am stuck
</li>
export class App {
textboxvalues:any[] = [];
list= [{
id: 1,
value: 'One'
},
{
id: 2,
value: 'Two'
}];
}
を持っています{id、value}を提供します。例えば、
{1:"textbox1", 2:"textbox2"}
あるいはオブジェクト
{1, "textbox1"}, {2, "textbox2"}
:// angle.io/guide/reactive-forms#reactive-forms)が最適なオプションかもしれません –