Pony.fm/resources/assets/scripts/app/controllers/tracks-list.coffee

18 lines
532 B
CoffeeScript
Raw Normal View History

2015-08-31 17:42:21 +02:00
window.pfm.preloaders['tracks-list'] = [
2015-10-25 03:35:37 +01:00
'tracks', '$state'
(tracks, $state) ->
tracks.loadFilters().then(->
tracks.mainQuery.fromFilterString($state.params.filter)
tracks.mainQuery.setPage $state.params.page || 1
2015-08-31 17:42:21 +02:00
2015-10-25 03:35:37 +01:00
tracks.mainQuery.fetch()
)
2015-08-31 17:42:21 +02:00
]
angular.module('ponyfm').controller "tracks-list", [
2015-10-25 03:35:37 +01:00
'$scope', 'tracks', '$state',
($scope, tracks, $state) ->
tracks.mainQuery.fetch().done (searchResults) ->
$scope.tracks = searchResults.tracks
]