我有一个表单,它的数组值采用这种数组格式,因为我不知道如何动态添加表单输入,所以我不得不手动添加。现在,当我尝试提交表单时,显示了这个错误
错误类型错误:无法读取未定义的属性“value”
post.html网站
<ion-item class="mylist chat-item item-remove-animate item-avatar item-icon-right list card animated fadeInUp">
<ion-input type="text" readonly name="party" placeholder="APC" value="apc"></ion-input>
<ion-input type="number" placeholder="Total Votes" name="vote" #vote></ion-input>
</ion-item>
<ion-item class="mylist chat-item item-remove-animate item-avatar item-icon-right list card animated fadeInUp">
<ion-input type="text" readonly name="party" value="pdp"></ion-input>
<ion-input type="number" placeholder="Total Votes" name="vote" #vote></ion-input>
</ion-item>
<ion-item class="mylist chat-item item-remove-animate item-avatar item-icon-right list card animated fadeInUp">
<ion-input type="text" readonly name="party" value="apga"></ion-input>
<ion-input type="number" placeholder="Total Votes" name="vote" #vote></ion-input>
</ion-item>
邮政信箱
@ViewChild("party") party;
@ViewChild("vote") vote;
@ViewChild("phones")phones;
submit(){
let data = {
party: this.party.value,
vote: this.vote.value,
phone: this.phones.value
};
}
请告诉我如何传递这些数组值?
谢谢