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';
|
||||
|
||||
angular.module('cosign',[
|
||||
'ngRoute',
|
||||
'ui.bootstrap',
|
||||
'ui.router'
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -3,22 +3,29 @@
|
|||
//Setting up route
|
||||
angular
|
||||
.module('cosign')
|
||||
.config(function($routeProvider) {
|
||||
$routeProvider.
|
||||
when('signin', {
|
||||
templateUrl: '/views/signin.html',
|
||||
title: 'Signin'
|
||||
.config(function($stateProvider, $urlRouterProvider) {
|
||||
// For unmatched routes:
|
||||
$urlRouterProvider.otherwise('/');
|
||||
|
||||
// States for cosign
|
||||
$stateProvider
|
||||
.state('home', {
|
||||
url: '/',
|
||||
templateUrl: 'views/home.html'
|
||||
})
|
||||
.otherwise({
|
||||
templateUrl: '/views/404.html',
|
||||
title: 'Error'
|
||||
.state('signin', {
|
||||
url: '/signin',
|
||||
templateUrl: 'views/signin.html'
|
||||
})
|
||||
.state('404', {
|
||||
url: '/404',
|
||||
templateUrl: 'views404.hmtl'
|
||||
});
|
||||
});
|
||||
|
||||
//Setting HTML5 Location Mode
|
||||
angular
|
||||
.module('insight')
|
||||
.module('cosign')
|
||||
.config(function($locationProvider) {
|
||||
$locationProvider.html5Mode(true);
|
||||
$locationProvider.hashPrefix('!');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
angular.element(document).ready(function() {
|
||||
// Init the app
|
||||
// angular.bootstrap(document, ['cosign']);
|
||||
angular.bootstrap(document, ['cosign']);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue