Moved to ui.router
diff --git a/mCordPortal/src/cord.js b/mCordPortal/src/cord.js
index 2636fba..62b388c 100644
--- a/mCordPortal/src/cord.js
+++ b/mCordPortal/src/cord.js
@@ -18,7 +18,7 @@
'use strict';
var modules = [
- 'ngRoute',
+ 'ui.router',
'ngResource',
'ngAnimate',
'ngCookies',
@@ -32,33 +32,34 @@
];
angular.module('cordGui', modules)
- .config(function ($routeProvider, $httpProvider) {
+ .config(function ($stateProvider, $httpProvider) {
$httpProvider.interceptors.push('SetCSRFToken');
- $routeProvider
- .when('/login', {
- controller: 'CordLoginCtrl',
- controllerAs: 'ctrl',
- templateUrl: 'app/view/login/login.html'
- })
- .when('/home', {
+ $stateProvider
+ .state('home', {
+ url: '/',
controller: 'CordHomeCtrl',
controllerAs: 'ctrl',
templateUrl: 'app/view/home/home.html'
})
- .when('/user', {
+ .state('login', {
+ url: '/login',
+ controller: 'CordLoginCtrl',
+ controllerAs: 'ctrl',
+ templateUrl: 'app/view/login/login.html'
+ })
+ .state('user', {
+ url: '/user',
controller: 'CordUserCtrl',
controllerAs: 'ctrl',
templateUrl: 'app/view/user/user.html'
})
- .when('/bundle', {
+ .state('bundle', {
+ url: '/bundle',
controller: 'CordBundleCtrl',
controllerAs: 'ctrl',
templateUrl: 'app/view/bundle/bundle.html'
- })
- .otherwise({
- redirectTo: '/login'
});
})
.controller('CordCtrl', function ($scope, $location, cordConfig) {
@@ -125,7 +126,7 @@
cordConfig.url = 'http://' + $location.host() + ':' + $location.port();
// basic authentication
- $rootScope.$on('$routeChangeStart', function(next, current) {
+ $rootScope.$on('$stateChangeStart', function(next, current) {
if(!User.isLoggedIn()){
$location.path('/login');
}