我正在使用这个帐户,因为我在我的另一个登录Facebook,我没有我的手机与我做密码验证等..
无论如何..我试图从ng模型中获取价值,但无论我尝试什么,我似乎无法得到它。我想我需要另外一些眼睛快速查看我的代码,看看他们是否可以解决这个问题,干杯......
Html:
<div class="form-group"><label class="col-sm-2 control-label">Established :</label>
<div class="col-sm-10"><input type="text" class="form-control" ng-model="established"></div>
</div>
<button class="btn btn-primary " style="float:right;" ng-click="saveApprisalDetails()" type="button"><i class="fa fa-paste"></i> Save</button>
Controller:
$scope.saveApprisalDetails=function(){
var urlgetappraisals = './dbscripts/getAppraisalsByRef.php?ref=' + ref
console.log(urlgetappraisals);
$http({
method: 'GET',
url: urlgetappraisals
}).success(function(data) {
$scope.appraisaldetails = data;
console.log(JSON.stringify(data));
var url = './dbscripts/saveApprisal.php?id=' + data[0].id;
url += '&appraisalCompany=' + appraisalCompany;
url += '&title=' + ref;
url += '&established=' + $scope.established;
console.log(url);
$http({
method: 'GET',
url: url
}).success(function(data) {
})
})
}
}
catch(e){}
}
答案 0 :(得分:0)
也许在控制器的开头尝试不同的东西,看它是否有效:
$scope.view_data = {};
在功能中:
url += '&established=' + $scope.vies_data.established;
在视图中:
<input type="text" class="form-control" ng-model="view_data.established">
希望有帮助=)