我根据我的商品['1','2']
重复此输入,然后输入ng-model:
<form id="register-form" form ng-submit="successbloodstock.updateRemark()" >
<div class="input-group input-group">
<div class="input-group-addon" style="width:130px">
<small>EXPIRATION DATE</small>
</div>
<input class="form-control" type="date" name="expiry_date"
ng-model="newExpiry" required>
</div>
</form>
但是提交表单后,它不会将ng-model显示为数组:
.controller('successbloodstockCtrl', function($scope,$timeout,$location,$route,$routeParams,$http) {
var app = this;
app.number=['asdf','asadf'];
app.updateRemark = function() {
var userObject = {};
userObject.expiry_date = $scope.newExpiry;
console.log($scope.newExpiry[$index])
}
}
这给了我未定义的