0
내가 달러 (A $)의 HTTP 요청
$http.get('http://api.worldweatheronline.com/free/v2/weather.ashx?q=Manchester&format=json&num_of_days=5&key=1e9bfc54489901fe117e6f2877018')
.success(function(response) {
$scope.worldweather = response;
});
을하고 말을하지만 난 범위 값으로 URL의 도시 이름을 바꾸려면 URL에 포함, 나는 ID가 수 생각 이런 식으로 할거야. 아냐, 아냐. 어떤 제안?
$scope.city = 'Manchester';
$http.get('http://api.worldweatheronline.com/free/v2/weather.ashx?q=' + city + '&format=json&num_of_days=5&key=1e9bfc54489901fe117e6f2877018')
.success(function(response) {
$scope.worldweather = response;
});
왜'city' 그것을 구축하는 것이 더 쉬울 수도 있습니다 아니라'$의 scope.city' 등을 변수? – veritas1
그 덕분에! – user3224271
실제로 범위가 도시에 연결되기를 원했기 때문에 실제로 이유가있었습니다 ... 검색하고 있습니다. 지금은 작동하지 않습니다. – user3224271