update to angular-ui-router
This commit is contained in:
parent
d9f286379e
commit
b4ee4f452d
3 changed files with 20 additions and 12 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('cosign',[
|
angular.module('cosign',[
|
||||||
'ngRoute',
|
'ui.bootstrap',
|
||||||
|
'ui.router'
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,29 @@
|
||||||
//Setting up route
|
//Setting up route
|
||||||
angular
|
angular
|
||||||
.module('cosign')
|
.module('cosign')
|
||||||
.config(function($routeProvider) {
|
.config(function($stateProvider, $urlRouterProvider) {
|
||||||
$routeProvider.
|
// For unmatched routes:
|
||||||
when('signin', {
|
$urlRouterProvider.otherwise('/');
|
||||||
templateUrl: '/views/signin.html',
|
|
||||||
title: 'Signin'
|
// States for cosign
|
||||||
|
$stateProvider
|
||||||
|
.state('home', {
|
||||||
|
url: '/',
|
||||||
|
templateUrl: 'views/home.html'
|
||||||
})
|
})
|
||||||
.otherwise({
|
.state('signin', {
|
||||||
templateUrl: '/views/404.html',
|
url: '/signin',
|
||||||
title: 'Error'
|
templateUrl: 'views/signin.html'
|
||||||
|
})
|
||||||
|
.state('404', {
|
||||||
|
url: '/404',
|
||||||
|
templateUrl: 'views404.hmtl'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//Setting HTML5 Location Mode
|
//Setting HTML5 Location Mode
|
||||||
angular
|
angular
|
||||||
.module('insight')
|
.module('cosign')
|
||||||
.config(function($locationProvider) {
|
.config(function($locationProvider) {
|
||||||
$locationProvider.html5Mode(true);
|
|
||||||
$locationProvider.hashPrefix('!');
|
$locationProvider.hashPrefix('!');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
angular.element(document).ready(function() {
|
angular.element(document).ready(function() {
|
||||||
// Init the app
|
// Init the app
|
||||||
// angular.bootstrap(document, ['cosign']);
|
angular.bootstrap(document, ['cosign']);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue