我有一个像getParentSys.query({tl1Address: '172.28.71.155'}
这样的休息电话
哪个工作正常,但我想将$scope.country.adtranTL1GatewayIPAddress
变量中的ips作为变量放入其余的调用中。
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";
});
}
}
请帮忙
答案 0 :(得分:0)
在看到你如何实现你的html并没有完整的服务代码之后。我假设您需要将$scope.country.adtranTL1GatewayIPAddress
嵌入为字符串。看到您的代码,getParentSys
必须是您的service
。
只需在您的控制器中
IF getParentSys.query({tl1Address: '172.28.71.155'});
yourApp.controller('testController',function($scope,getParentSys){
$scope.matchingScope = "'"+$scope.country.adtranTL1GatewayIPAddress+"'";
getParentSys.query({tl1Address: $scope.matchingScope});
})
IF getParentSys.query({'tl1Address': '172.28.71.155'});
yourApp.controller('testController',function($scope,getParentSys){
$scope.matchingScope = "'"+$scope.country.adtranTL1GatewayIPAddress+"'";
getParentSys.query({'tl1Address': $scope.matchingScope});
})
还有其他方法可以实现上述目标。