use ui-router instead of routeProvider

This commit is contained in:
Athou
2013-03-29 15:09:50 +01:00
parent 60bcb64828
commit fc8bd5c812
14 changed files with 1145 additions and 80 deletions

View File

@@ -1,12 +1,28 @@
var app = angular.module('commafeed', [ 'ui', 'ui.bootstrap',
'commafeed.directives', 'commafeed.controllers', 'commafeed.services',
var app = angular.module('commafeed', [ 'ui', 'ui.bootstrap', 'ui.state',
'commafeed.directives', 'commafeed.controllers', 'commafeed.services',
'ngSanitize', 'ngUpload', 'infinite-scroll' ]);
app.config([ '$routeProvider', function($routeProvider) {
$routeProvider.when('/feeds/view/:_type/:_id', {
templateUrl : 'templates/feeds.html'
app.config(function($urlRouterProvider, $stateProvider) {
$stateProvider.state('feeds', {
abstract: true,
url: '/feeds',
templateUrl: 'templates/feeds.html'
});
$routeProvider.otherwise({
redirectTo : '/feeds/view/category/all'
$stateProvider.state('feeds.view', {
url: '/view/:_type/:_id',
templateUrl : 'templates/feeds.view.html'
});
} ]);
$stateProvider.state('admin', {
abstract: true,
url: '/admin',
templateUrl: 'templates/admin.html'
});
$stateProvider.state('admin.users', {
url: '/users',
templateUrl : 'templates/admin.users.html'
});
$urlRouterProvider.when('/', '/feeds/view/category/all');
$urlRouterProvider.when('/admin', '/admin/users');
});