Skip to content

Instantly share code, notes, and snippets.

@elbuo8
Last active January 2, 2016 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbuo8/8373639 to your computer and use it in GitHub Desktop.
Save elbuo8/8373639 to your computer and use it in GitHub Desktop.
$routeProvider.when('/home', {
templateUrl: 'templates/player.html',
controller: 'PlayerCtrl'
});
service('Playlist', ['$http', '$q', function ($http, $q) {
return {get: function (params) {
var deferred = $q.defer();
$http.get('http://hypem.com/playlist/' + params.playlist + '/all/json/' + params.pagenum + '/data.json')
.success(function (data) {
deferred.resolve(data);
})
.error(function(data) {
deferred.reject(data);
});
return deferred.promise;
}};
}]);
<ng-view></ng-view>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment