{
"dependencies": {
"ng-deezer-sdk": "[email protected]:gianarb/ng-deezer-sdk.git"
}
}
<script src="incude/script/deezer.js"></script>
<script src="//cdn-files.deezer.com/js/min/dz.js"></script>
Include my module and deezer official sdk
angular.module( 'ngBoilerplate', [
'gianarb.deezer'
])
.config(function myAppConfig ($deezerProvider) {
// Init provider configuration
$deezerProvider.setChannelUrl("http://yourchannel.url");
$deezerProvider.setAppId("xxxxxx");
})
.run(['DeezerFactory', '$rootScope', function run (DeezerFactory, $rootScope) {
//Check if I'm already logged
if(!$rootScope.user_data){
DeezerFactory.login(function(response){
$rootScope.user_data = {
"access_token" : response.authResponse.accessToken,
"user_id" : response.userID
};
});
}
}])
.controller( 'HomeCtrl', ['$scope', 'deezer', function HomeController( $scope, deezer ) {
deezer.api('album/7723488').then(function(resp){
$scope.album = resp;
});
}]);