accountant-ui/src/app.js

68 lines
2.2 KiB
JavaScript
Raw Normal View History

2016-10-09 20:17:11 +02:00
// vim: set tw=80 ts=4 sw=4 sts=4:
2016-04-12 10:55:08 +02:00
/*
This file is part of Accountant.
Accountant is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Accountant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
*/
2017-06-10 18:02:19 +02:00
/* jshint node: true */
2016-04-12 10:55:08 +02:00
'use strict';
2017-06-10 18:02:19 +02:00
var angular = require('angular');
var ngRoute = require('angular-route');
2017-06-10 18:02:19 +02:00
var accountModule = require('./accounts'),
loginModule = require('./login'),
2017-06-10 18:02:19 +02:00
operationModule = require('./operations'),
schedulerModule = require('./scheduler');
require('bootstrap-webpack!./bootstrap.config.js');
2017-06-10 22:06:36 +02:00
var operationsTmpl = require('./operations/operations.html');
var accountsTmpl = require('./accounts/accounts.html');
var schedulerTmpl = require('./scheduler/scheduler.html');
2017-06-10 18:02:19 +02:00
var app = angular.module('accountant', [
accountModule.name,
loginModule.name,
2017-06-10 18:02:19 +02:00
operationModule.name,
schedulerModule.name,
ngRoute,
2016-04-12 10:55:08 +02:00
])
2017-07-05 21:48:20 +02:00
.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'
});
});
2017-06-10 18:02:19 +02:00
module.exports = app;