【发布时间】:2016-02-12 00:01:12
【问题描述】:
我有一些使用 ng-repeat 动态生成的 texbox:
<ion-content>
<div class="matchList">
<div class="matchListItem" ng-repeat="match in matchData">
<div class="home-team-name">
{{match.Team1.TeamName}}
</div>
<div class="tip-input">
<input type="text" style="border:1px solid #CCC; width:100%; height:23px; padding-left:4px;" />
</div>
<div class="tip-center">
<center>:</center>
</div>
<div class="tip-input">
<input type="text" style="border:1px solid #CCC; width:100%; height:23px; padding-left:4px;" />
</div>
<div class="guest-team-name">
{{match.Team2.TeamName}}
</div>
<div style="clear:both"></div>
</div>
</div>
<div class="save-button">
<button class="button button-block button-positive" ng-click="save()">
Save
</button>
</div>
</ion-content>
这是足球联赛的提示游戏。因此,比赛日的每场比赛都有两个文本框。我想将文本框的值发送到 php 文件。我知道我可以这样做:
$scope.save = function () {
$http.get('http://localhost/saveTips.php?data=' + data).then(function (response) {
$scope.doesItWork = response.data;
})
}
但是如何将每个文本框的值保存在数据变量中以将其发送到 php 文件?
【问题讨论】:
标签: javascript angularjs forms ionic submit