2013-08-01 10:57:08 +02:00
|
|
|
window.pfm.preloaders['playlist'] = [
|
|
|
|
'$state', 'playlists'
|
|
|
|
($state, playlists) ->
|
|
|
|
playlists.fetch $state.params.id, true
|
|
|
|
]
|
2013-07-28 19:45:21 +02:00
|
|
|
|
2013-08-01 10:57:08 +02:00
|
|
|
angular.module('ponyfm').controller 'playlist', [
|
2013-08-29 05:19:24 +02:00
|
|
|
'$scope', '$state', 'playlists', '$dialog'
|
|
|
|
($scope, $state, playlists, $dialog) ->
|
|
|
|
playlist = null
|
|
|
|
|
|
|
|
playlists.fetch($state.params.id).done (playlistResponse) ->
|
|
|
|
$scope.playlist = playlistResponse
|
|
|
|
playlist = playlistResponse
|
|
|
|
|
|
|
|
$scope.share = () ->
|
|
|
|
dialog = $dialog.dialog
|
|
|
|
templateUrl: '/templates/partials/playlist-share-dialog.html',
|
|
|
|
controller: ['$scope', ($scope) -> $scope.playlist = playlist; $scope.close = () -> dialog.close()]
|
|
|
|
dialog.open()
|
2013-07-28 19:45:21 +02:00
|
|
|
]
|