2013-08-01 04:01:41 +02:00
|
|
|
window.pfm.preloaders['artist'] = [
|
|
|
|
'artists', '$state'
|
|
|
|
(artists, $state) ->
|
2013-08-01 04:47:21 +02:00
|
|
|
artists.fetch $state.params.slug, true
|
2013-08-01 04:01:41 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
angular.module('ponyfm').controller "artist", [
|
2013-08-29 05:19:24 +02:00
|
|
|
'$scope', 'artists', '$state', 'follow'
|
|
|
|
($scope, artists, $state, follow) ->
|
2013-09-01 23:54:33 +02:00
|
|
|
artists.fetch($state.params.slug)
|
|
|
|
.done (artistResponse) ->
|
|
|
|
$scope.artist = artistResponse.artist
|
2013-08-29 05:19:24 +02:00
|
|
|
|
|
|
|
$scope.toggleFollow = () ->
|
|
|
|
follow.toggle('artist', $scope.artist.id).then (res) ->
|
|
|
|
$scope.artist.user_data.is_following = res.is_followed
|
2013-08-01 04:01:41 +02:00
|
|
|
]
|