update to angular-ui-router

This commit is contained in:
Mario Colque 2014-03-18 13:22:20 -03:00
commit b4ee4f452d
3 changed files with 20 additions and 12 deletions

View file

@ -1,5 +1,6 @@
'use strict';
angular.module('cosign',[
'ngRoute',
'ui.bootstrap',
'ui.router'
]);

View file

@ -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('!');
});

View file

@ -2,5 +2,5 @@
angular.element(document).ready(function() {
// Init the app
// angular.bootstrap(document, ['cosign']);
angular.bootstrap(document, ['cosign']);
});