diff --git a/js/app.js b/js/app.js index 8c33adc..3d24aad 100644 --- a/js/app.js +++ b/js/app.js @@ -1,7 +1,7 @@ 'use strict'; // Declare app level module which depends on filters, and services -angular.module('podcasts', ['podcasts.services', 'podcasts.updater', 'podcasts.database', 'podcast.directives', 'podcasts.importer']). +angular.module('podcasts', ['podcasts.services', 'podcasts.updater', 'podcasts.database', 'podcast.directives', 'podcasts.importer', 'podcasts.router']). config(['$routeProvider', function($routeProvider) { $routeProvider.when('/feeds', {templateUrl: 'partials/listFeeds.html', controller: FeedListCtrl}); $routeProvider.when('/feed/:feedId', {templateUrl: 'partials/feed.html', controller: FeedCtrl}); diff --git a/js/services.js b/js/services.js index 58a9347..579d338 100644 --- a/js/services.js +++ b/js/services.js @@ -644,4 +644,15 @@ angular.module('podcasts.importer', ['podcasts.utilities', 'podcasts.services']) } }; }]) -; \ No newline at end of file +; +angular.module('podcasts.router', []) + .service('pageChanger', ['$location', function($location) { + function goToFeed(feedId) { + $location.path('/feed/' + feedId); + } + + return { + goToFeed: goToFeed + }; + }]) +;