Files
MASA/app/partials/section/section.module.js

79 lines
2.5 KiB
JavaScript
Raw Normal View History

2016-02-29 00:49:18 -04:30
(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){
2016-04-11 00:05:59 -04:30
$urlRouterProvider.otherwise('/SectionList');
2016-02-29 00:49:18 -04:30
$stateProvider
2016-04-11 00:05:59 -04:30
.state('SectionList', {
url: '/SectionList',
2016-02-29 00:49:18 -04:30
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
2016-04-11 00:05:59 -04:30
controller: 'SidebarCtrl'
2016-02-29 00:49:18 -04:30
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
2016-02-29 00:49:18 -04:30
},
content: {
2016-04-11 00:05:59 -04:30
templateUrl: 'partials/section/section_list.html',
controller: 'SectionListCtrl',
2016-02-29 00:49:18 -04:30
controllerAs: 'vm'
}
}
})
2016-04-11 00:05:59 -04:30
.state('SectionCreate', {
url: '/SectionCreate',
2016-02-29 00:49:18 -04:30
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
2016-04-11 00:05:59 -04:30
controller: 'SidebarCtrl'
2016-02-29 00:49:18 -04:30
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
2016-02-29 00:49:18 -04:30
},
content: {
2016-04-11 00:05:59 -04:30
templateUrl: 'partials/section/section_create.html',
controller: 'SectionCreateCtrl',
2016-02-29 00:49:18 -04:30
controllerAs: 'vm'
}
}
})
2016-04-11 00:05:59 -04:30
.state('SectionUpdate', {
url: '/SectionUpdate',
2016-02-29 00:49:18 -04:30
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
2016-04-11 00:05:59 -04:30
controller: 'SidebarCtrl'
2016-02-29 00:49:18 -04:30
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
2016-02-29 00:49:18 -04:30
},
content: {
2016-04-11 00:05:59 -04:30
templateUrl: 'partials/section/section_update.html',
controller: 'SectionUpdateCtrl',
2016-02-29 00:49:18 -04:30
controllerAs: 'vm'
}
}
})
};
})();