私はチュートリアルが作成されて以来、私は自分のサービスで使用しなければならないリンクが変更されているので、 apam.openweathermap.orgが今必要とするappidであるparamのparam
function weatherFactory($http) {
return {
getWeather: function(city, country) {
var query = city + ', ' + country;
var key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
return $http.get('http://api.openweathermap.org/data/2.5/weather?', {
params: {
q: query,
appid: key
}
}).then(function(response) {
// //then() returns a promise which
// is resolved with return value of success callback
return response.data.weather[0].description;
});
}
};
}
のリンクは次のようになります。だから私は、getにおける第二のparamsのようにキーを入れて、しかし私は、APPIDの前でこの&を追加する方法がわからない
http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b1b15e88fa797225412429c1c50c122a1
それらのリンクの例のようになります。 誰かがそれを行う方法を教えてもらえますか?
あなたの質問は正確ですか?どのようにURLを作成する?、paramsを追加する方法? –