Javascript Angularjs+;Restanglar,搜索相册&;spotify上的艺术家
我使用restangular模块与spotify API建立连接,并获取相册和艺术家的搜索结果 当我拿到一张专辑或一位艺术家时,它是可以的。问题是当我将参数传递给restanglar以搜索结果时RESTANGLAR将symolsJavascript Angularjs+;Restanglar,搜索相册&;spotify上的艺术家,javascript,angularjs,http,spotify,restangular,Javascript,Angularjs,Http,Spotify,Restangular,我使用restangular模块与spotify API建立连接,并获取相册和艺术家的搜索结果 当我拿到一张专辑或一位艺术家时,它是可以的。问题是当我将参数传递给restanglar以搜索结果时RESTANGLAR将symols&和=转换为特殊字符,这使得URL无法工作 例如,我有下面的片段来搜索相册/艺术家: //I pass : https://api.spotify.com/v1/search?q=album:lo%20artist:lo&type=album,artist co
&
和=
转换为特殊字符,这使得URL无法工作
例如,我有下面的片段来搜索相册/艺术家:
//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);
});
但是我得到了一个错误的URL:
有人能告诉我这些符号是如何保持不变的吗?这里有两件事不对