Files
MASA/app/partials/section/section.module.js
2016-04-11 00:05:59 -04:30

79 lines
2.5 KiB
JavaScript

(function(){
'use strict';
angular
.module("app.section", ['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('/SectionList');
$stateProvider
.state('SectionList', {
url: '/SectionList',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'SidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
templateUrl: 'partials/section/section_list.html',
controller: 'SectionListCtrl',
controllerAs: 'vm'
}
}
})
.state('SectionCreate', {
url: '/SectionCreate',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'SidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
templateUrl: 'partials/section/section_create.html',
controller: 'SectionCreateCtrl',
controllerAs: 'vm'
}
}
})
.state('SectionUpdate', {
url: '/SectionUpdate',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'SidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
templateUrl: 'partials/section/section_update.html',
controller: 'SectionUpdateCtrl',
controllerAs: 'vm'
}
}
})
};
})();