Move accountId retrieving into account module.
This commit is contained in:
parent
fab4880389
commit
e73d105420
@ -25,10 +25,27 @@ import {
|
|||||||
downgradeComponent
|
downgradeComponent
|
||||||
} from '@angular/upgrade/static';
|
} from '@angular/upgrade/static';
|
||||||
|
|
||||||
|
import uiRouter from '@uirouter/angularjs';
|
||||||
|
|
||||||
import { AccountService } from './account.service';
|
import { AccountService } from './account.service';
|
||||||
import { AccountListComponent } from './accountList.component';
|
import { AccountListComponent } from './accountList.component';
|
||||||
|
|
||||||
export default angular.module('accountant.accounts', [])
|
export default angular.module('accountant.accounts', [
|
||||||
|
uiRouter
|
||||||
|
])
|
||||||
|
|
||||||
|
.factory('accountIdService', function() {
|
||||||
|
var accountId: null;
|
||||||
|
|
||||||
|
return {
|
||||||
|
get: () => {
|
||||||
|
return accountId;
|
||||||
|
},
|
||||||
|
set: (value) => {
|
||||||
|
accountId = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
.factory('AccountService', downgradeInjectable(AccountService))
|
.factory('AccountService', downgradeInjectable(AccountService))
|
||||||
|
|
||||||
@ -36,4 +53,10 @@ export default angular.module('accountant.accounts', [])
|
|||||||
component: AccountListComponent
|
component: AccountListComponent
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
.run(function($transitions, accountIdService) {
|
||||||
|
$transitions.onSuccess({}, (transition) => {
|
||||||
|
accountIdService.set(transition.params().accountId);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
.name;
|
.name;
|
||||||
|
@ -30,14 +30,15 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|||||||
import { ToastrService } from 'ngx-toastr';
|
import { ToastrService } from 'ngx-toastr';
|
||||||
|
|
||||||
var ngStrap = require('angular-strap');
|
var ngStrap = require('angular-strap');
|
||||||
import uiRouter from '@uirouter/angularjs';
|
|
||||||
|
import accountModule from '@accountant/accounts';
|
||||||
|
|
||||||
import { ScheduleListComponent } from './scheduleList.component';
|
import { ScheduleListComponent } from './scheduleList.component';
|
||||||
import { ScheduleService } from './schedule.service';
|
import { ScheduleService } from './schedule.service';
|
||||||
|
|
||||||
export default angular.module('accountant.scheduler', [
|
export default angular.module('accountant.scheduler', [
|
||||||
uiRouter,
|
ngStrap,
|
||||||
ngStrap
|
accountModule
|
||||||
])
|
])
|
||||||
.factory('toastrService', downgradeInjectable(ToastrService))
|
.factory('toastrService', downgradeInjectable(ToastrService))
|
||||||
|
|
||||||
@ -45,29 +46,10 @@ export default angular.module('accountant.scheduler', [
|
|||||||
|
|
||||||
.factory('logger', downgradeInjectable(Logger))
|
.factory('logger', downgradeInjectable(Logger))
|
||||||
|
|
||||||
.factory('accountIdService', function() {
|
|
||||||
var accountId: null;
|
|
||||||
|
|
||||||
return {
|
|
||||||
get: () => {
|
|
||||||
return accountId;
|
|
||||||
},
|
|
||||||
set: (value) => {
|
|
||||||
accountId = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
.factory('scheduleService', downgradeInjectable(ScheduleService))
|
.factory('scheduleService', downgradeInjectable(ScheduleService))
|
||||||
|
|
||||||
.directive('scheduleListComponent', downgradeComponent({
|
.directive('scheduleListComponent', downgradeComponent({
|
||||||
component: ScheduleListComponent
|
component: ScheduleListComponent
|
||||||
}))
|
}))
|
||||||
|
|
||||||
.run(function($transitions, accountIdService) {
|
|
||||||
$transitions.onSuccess({}, (transition) => {
|
|
||||||
accountIdService.set(transition.params().accountId);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
.name;
|
.name;
|
||||||
|
Loading…
Reference in New Issue
Block a user