Update routes, mongoose schema and web flow

This commit is contained in:
Reynaldo Reyes
2016-03-27 23:24:28 -04:30
parent b8b65e64d7
commit 7fff896e43
34 changed files with 735 additions and 631 deletions

View File

@@ -0,0 +1,75 @@
(function(){
'use strict';
angular
.module("app.professor", ['ui.router', 'ui.bootstrap'])
.run(addStateToScope)
.config(getRoutes);
addStateToScope.$inject = ['$rootScope', '$state', '$stateParams'];
function addStateToScope($rootScope, $state, $stateParams){
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
};
getRoutes.$inject = ['$stateProvider', '$urlRouterProvider'];
function getRoutes($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise('/listarProfesor');
$stateProvider
.state('listarProfesor', {
url: '/listarProfesor',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'sidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
templateUrl: 'partials/professor/list_professor.html',
controller: 'listarProfesorCtrl',
controllerAs: 'vm'
}
}
})
.state('crearProfesor', {
url: '/crearProfesor',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'sidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
templateUrl: 'partials/professor/create_professor.html',
controller: 'crearProfesorCtrl',
controllerAs: 'vm'
}
}
})
.state('actualizarProfesor', {
url: '/actualizarProfesor',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'sidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
templateUrl: 'partials/professor/update_professor.html',
controller: 'actualizarProfesorCtrl',
controllerAs: 'vm'
}
}
})
};
})();