Separate app.config in another file.
This commit is contained in:
parent
2fb98fdeed
commit
fbeb3fd362
22
src/app.config.js
Normal file
22
src/app.config.js
Normal file
@ -0,0 +1,22 @@
|
||||
module.exports = function($routeProvider) {
|
||||
// Defining template and controller in function of route.
|
||||
$routeProvider
|
||||
.when('/account/:accountId/operations', {
|
||||
templateUrl: operationsTmpl,
|
||||
controller: 'OperationController',
|
||||
controllerAs: 'operationsCtrl'
|
||||
})
|
||||
.when('/account/:accountId/scheduler', {
|
||||
templateUrl: schedulerTmpl,
|
||||
controller: 'SchedulerController',
|
||||
controllerAs: 'schedulerCtrl'
|
||||
})
|
||||
.when('/accounts', {
|
||||
templateUrl: accountsTmpl,
|
||||
controller: 'AccountController',
|
||||
controllerAs: 'accountsCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/accounts'
|
||||
});
|
||||
};
|
31
src/app.js
31
src/app.js
@ -27,41 +27,18 @@ var accountModule = require('./accounts'),
|
||||
operationModule = require('./operations'),
|
||||
schedulerModule = require('./scheduler');
|
||||
|
||||
var routing = require('./app.config');
|
||||
|
||||
require('bootstrap-webpack!./bootstrap.config.js');
|
||||
|
||||
var operationsTmpl = require('./operations/operations.html');
|
||||
var accountsTmpl = require('./accounts/accounts.html');
|
||||
var schedulerTmpl = require('./scheduler/scheduler.html');
|
||||
|
||||
var app = angular.module('accountant', [
|
||||
angular.module('accountant', [
|
||||
accountModule,
|
||||
loginModule,
|
||||
operationModule,
|
||||
schedulerModule,
|
||||
ngRoute,
|
||||
])
|
||||
|
||||
.config(function($routeProvider) {
|
||||
// Defining template and controller in function of route.
|
||||
$routeProvider
|
||||
.when('/account/:accountId/operations', {
|
||||
templateUrl: operationsTmpl,
|
||||
controller: 'OperationController',
|
||||
controllerAs: 'operationsCtrl'
|
||||
})
|
||||
.when('/account/:accountId/scheduler', {
|
||||
templateUrl: schedulerTmpl,
|
||||
controller: 'SchedulerController',
|
||||
controllerAs: 'schedulerCtrl'
|
||||
})
|
||||
.when('/accounts', {
|
||||
templateUrl: accountsTmpl,
|
||||
controller: 'AccountController',
|
||||
controllerAs: 'accountsCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/accounts'
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
]).config(routing);
|
||||
|
Loading…
Reference in New Issue
Block a user