0
我使用restangular模塊連接到spotify API並獲取專輯和藝術家的搜索結果。Angularjs + restangular,spotify上的搜索專輯和藝術家
當我獲取專輯或藝術家時,它是可以的。問題是當我通過params重新尋找結果。 restangular轉換symols &
和=
特殊字符,這使得沒有工作
,比如我有下面的代碼片段搜索專輯/藝術家的網址:
//I pass : https://api.spotify.com/v1/search?q=album:lo%20artist:lo&type=album,artist
const params = "album:lo+artist:lo&type=album,artist";
Restangular.all(SEARCH_END_POINT).getList({q: params}).then(function(data){
console.log("All ok");
console.log(data[0].name);
}, function(response) {
console.log("Error with status code", response.status);
});
有人可以告訴我這些符號是如何保持不變&
和=
?