Pony.fm/resources/assets/scripts/app/controllers/tracks-list.coffee
2015-10-24 19:35:37 -07:00

17 lines
532 B
CoffeeScript

window.pfm.preloaders['tracks-list'] = [
'tracks', '$state'
(tracks, $state) ->
tracks.loadFilters().then(->
tracks.mainQuery.fromFilterString($state.params.filter)
tracks.mainQuery.setPage $state.params.page || 1
tracks.mainQuery.fetch()
)
]
angular.module('ponyfm').controller "tracks-list", [
'$scope', 'tracks', '$state',
($scope, tracks, $state) ->
tracks.mainQuery.fetch().done (searchResults) ->
$scope.tracks = searchResults.tracks
]