mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
19 lines
556 B
JavaScript
19 lines
556 B
JavaScript
/*构建musicList服务*/
|
|
app.factory('musicList', ['$rootScope', '$http', 'ServiceConfig', function($rootScope, $http, ServiceConfig){
|
|
$rootScope.isNoLoaded = true;
|
|
var _MusicList = {
|
|
getData: function(keywords){
|
|
$rootScope.isNoLoaded = true;
|
|
$http.jsonp(ServiceConfig.music_search + '?callback=musicSearch&count=10&q=' + keywords);
|
|
|
|
window.musicSearch = function(data){
|
|
$rootScope.isNoLoaded = false;
|
|
if(data.musics && data.musics.length){
|
|
$rootScope.musicList = data.musics;
|
|
}
|
|
};
|
|
}
|
|
};
|
|
|
|
return _MusicList;
|
|
}]); |