mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-27 15:27:58 +01:00
19 lines
No EOL
528 B
CoffeeScript
19 lines
No EOL
528 B
CoffeeScript
window.pfm.preloaders['tracks-list'] = [
|
|
'tracks', '$state'
|
|
(tracks, $state) ->
|
|
tracks.loadFilters().then(->
|
|
if !tracks.mainQuery.hasLoadedFilters
|
|
tracks.mainQuery.fromFilterString($state.params.filter)
|
|
if $state.params.page
|
|
tracks.mainQuery.setPage $state.params.page
|
|
|
|
tracks.mainQuery.fetch()
|
|
)
|
|
]
|
|
|
|
angular.module('ponyfm').controller "tracks-list", [
|
|
'$scope', 'tracks', '$state',
|
|
($scope, tracks, $state) ->
|
|
tracks.mainQuery.fetch().done (searchResults) ->
|
|
$scope.tracks = searchResults.tracks
|
|
] |