a router service

This commit is contained in:
Colin Frei 2013-07-29 17:38:33 +02:00
parent 1f8b8b0f16
commit 5e32393680
2 changed files with 13 additions and 2 deletions

View file

@ -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});

View file

@ -644,4 +644,15 @@ angular.module('podcasts.importer', ['podcasts.utilities', 'podcasts.services'])
}
};
}])
;
;
angular.module('podcasts.router', [])
.service('pageChanger', ['$location', function($location) {
function goToFeed(feedId) {
$location.path('/feed/' + feedId);
}
return {
goToFeed: goToFeed
};
}])
;