a router service
This commit is contained in:
parent
1f8b8b0f16
commit
5e32393680
2 changed files with 13 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Declare app level module which depends on filters, and services
|
// 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) {
|
config(['$routeProvider', function($routeProvider) {
|
||||||
$routeProvider.when('/feeds', {templateUrl: 'partials/listFeeds.html', controller: FeedListCtrl});
|
$routeProvider.when('/feeds', {templateUrl: 'partials/listFeeds.html', controller: FeedListCtrl});
|
||||||
$routeProvider.when('/feed/:feedId', {templateUrl: 'partials/feed.html', controller: FeedCtrl});
|
$routeProvider.when('/feed/:feedId', {templateUrl: 'partials/feed.html', controller: FeedCtrl});
|
||||||
|
|
|
@ -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
|
||||||
|
};
|
||||||
|
}])
|
||||||
|
;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue