Move states in separate files.
This commit is contained in:
parent
7b7f72bf1e
commit
a7cee2891c
7
src/accounts/account.states.ts
Normal file
7
src/accounts/account.states.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
|
|
||||||
|
export const AccountListState = {
|
||||||
|
name: 'accounts',
|
||||||
|
url: '/accounts',
|
||||||
|
component: 'accountList'
|
||||||
|
}
|
@ -1,7 +1,9 @@
|
|||||||
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
import { Level } from '@nsalaun/ng-logger';
|
import { Level } from '@nsalaun/ng-logger';
|
||||||
|
|
||||||
var operationsTmpl = require('./operations/operations.html');
|
import { AccountListState } from './accounts/account.states';
|
||||||
|
import { OperationListState } from './operations/operation.states';
|
||||||
|
import { ScheduleListState } from './scheduler/schedule.states';
|
||||||
|
|
||||||
export default function AppConfig($uiRouterProvider) {
|
export default function AppConfig($uiRouterProvider) {
|
||||||
$uiRouterProvider.trace.enable(1);
|
$uiRouterProvider.trace.enable(1);
|
||||||
@ -9,33 +11,11 @@ export default function AppConfig($uiRouterProvider) {
|
|||||||
// Defining template and controller in function of route.
|
// Defining template and controller in function of route.
|
||||||
const $stateRegistry = $uiRouterProvider.stateRegistry;
|
const $stateRegistry = $uiRouterProvider.stateRegistry;
|
||||||
|
|
||||||
$stateRegistry.register({
|
$stateRegistry.register(OperationListState);
|
||||||
name: 'operations',
|
|
||||||
url: '/account/:accountId/operations',
|
|
||||||
templateUrl: operationsTmpl,
|
|
||||||
controller: 'OperationController',
|
|
||||||
controllerAs: 'operationsCtrl'
|
|
||||||
});
|
|
||||||
|
|
||||||
$stateRegistry.register({
|
$stateRegistry.register(ScheduleListState);
|
||||||
name: 'scheduler',
|
|
||||||
url: '/account/:accountId/scheduler',
|
|
||||||
component: 'scheduleComponent',
|
|
||||||
resolve: {
|
|
||||||
accountId: function($transition$) {
|
|
||||||
return $transition$.params().accountId;
|
|
||||||
},
|
|
||||||
$modal: function($modal) {
|
|
||||||
return $modal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$stateRegistry.register({
|
$stateRegistry.register(AccountListState);
|
||||||
name: 'accounts',
|
|
||||||
url: '/accounts',
|
|
||||||
component: 'accountList',
|
|
||||||
});
|
|
||||||
|
|
||||||
const $urlService = $uiRouterProvider.urlService;
|
const $urlService = $uiRouterProvider.urlService;
|
||||||
$urlService.rules.otherwise({
|
$urlService.rules.otherwise({
|
||||||
|
11
src/operations/operation.states.ts
Normal file
11
src/operations/operation.states.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
|
|
||||||
|
var operationsTmpl = require('./operations.html');
|
||||||
|
|
||||||
|
export const OperationListState = {
|
||||||
|
name: 'operations',
|
||||||
|
url: '/account/:accountId/operations',
|
||||||
|
templateUrl: operationsTmpl,
|
||||||
|
controller: 'OperationController',
|
||||||
|
controllerAs: 'operationsCtrl'
|
||||||
|
}
|
17
src/scheduler/schedule.states.ts
Normal file
17
src/scheduler/schedule.states.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
|
|
||||||
|
import { ScheduleComponent } from './schedule.component';
|
||||||
|
|
||||||
|
export const ScheduleListState = {
|
||||||
|
name: 'scheduler',
|
||||||
|
url: '/account/:accountId/scheduler',
|
||||||
|
component: 'scheduleComponent',
|
||||||
|
resolve: {
|
||||||
|
accountId: function($transition$) {
|
||||||
|
return $transition$.params().accountId;
|
||||||
|
},
|
||||||
|
$modal: function($modal) {
|
||||||
|
return $modal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user