我有一個休息電話,如getParentSys.query({tl1Address: '172.28.71.155'}
它工作正常,但我想把IP多數民衆贊成在$scope.country.adtranTL1GatewayIPAddress
變量到休息調用作爲變量。
HTML:
<input type="text" name="adtranTL1GatewayIPAddress" id="adtranTL1GatewayIPAddress" ng-model="country.adtranTL1GatewayIPAddress" data-toggle="tooltip" data-placement="right" title="<html>IP Address of the Adtran<br>TL1 gateway.<br>Consult your Network Administrator<br>for this value." />
<label for="adtranTL1GatewayIPAddress">Adtran TL1 Gateway IP Address</label>
控制器:
function EightXXCtrl($scope, getParentSys) {
$scope.getServingTA5000_8xx = function() {
var matchingScope = "'" + $scope.country.adtranTL1GatewayIPAddress + "'";
getParentSys.query({
tl1Address: '172.28.71.155'
}, function() {
$scope.log = "User saved";
}, function() {
$scope.log = "User could not be saved";
});
}
}
請幫
所以用變量替換字符串...不復雜 – charlietfl
使用getParentSys.query($ scope.country.adtranTL1GatewayIPAddress) –
@AlexRumbaNicked這不是正確的假設變量是一個IP字符串值。然而,OP需要顯示'scope.country'的更多細節是 – charlietfl