Make play button work on feed page

This commit is contained in:
Colin Frei 2013-08-21 17:42:54 +02:00
parent dacca59237
commit d223dfd662

View file

@ -28,7 +28,7 @@ function FeedListCtrl($scope, feeds, pageSwitcher, $location) {
pageSwitcher.change('feeds');
}
function FeedCtrl($scope, $routeParams, $location, feeds, pageSwitcher, feedItems) {
function FeedCtrl($scope, $routeParams, $location, feeds, pageSwitcher, feedItems, $rootScope) {
$scope.nrQueueItemsOptions = [1, 2, 3, 4, 5];
$scope.feed = {};
// show info at top and items underneath
@ -63,6 +63,12 @@ function FeedCtrl($scope, $routeParams, $location, feeds, pageSwitcher, feedItem
feedItems.addToQueue(id);
};
$scope.playItem = function(id) {
feedItems.get(id, function(feedItem) {
$rootScope.$broadcast('playItem', feedItem);
});
};
pageSwitcher.setBack('feeds');
}