2013-07-31 13:47:16 +02:00
|
|
|
window.pfm.preloaders['tracks-list'] = [
|
|
|
|
'tracks', '$state'
|
|
|
|
(tracks, $state) ->
|
2013-08-01 01:04:04 +02:00
|
|
|
tracks.loadFilters().then(->
|
2013-08-16 01:49:20 +02:00
|
|
|
tracks.mainQuery.fromFilterString($state.params.filter)
|
|
|
|
tracks.mainQuery.setPage $state.params.page || 1
|
2013-07-31 13:47:16 +02:00
|
|
|
|
|
|
|
tracks.mainQuery.fetch()
|
2013-08-01 01:04:04 +02:00
|
|
|
)
|
2013-07-31 13:47:16 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
angular.module('ponyfm').controller "tracks-list", [
|
|
|
|
'$scope', 'tracks', '$state',
|
|
|
|
($scope, tracks, $state) ->
|
|
|
|
tracks.mainQuery.fetch().done (searchResults) ->
|
|
|
|
$scope.tracks = searchResults.tracks
|
|
|
|
]
|