Inject $modal from router.

This commit is contained in:
Alexis Lahouze 2017-07-23 07:58:41 +02:00
parent 4f090a22df
commit 7b7f72bf1e
3 changed files with 6 additions and 2 deletions

View File

@ -24,6 +24,9 @@ export default function AppConfig($uiRouterProvider) {
resolve: { resolve: {
accountId: function($transition$) { accountId: function($transition$) {
return $transition$.params().accountId; return $transition$.params().accountId;
},
$modal: function($modal) {
return $modal;
} }
} }
}); });

View File

@ -49,7 +49,8 @@ export default angular.module('accountant.scheduler', [
.component('scheduleComponent', { .component('scheduleComponent', {
bindings: { bindings: {
accountId: '<' accountId: '<',
$modal: '<'
}, },
templateUrl: schedulerTmpl, templateUrl: schedulerTmpl,
controller: ScheduleComponent, controller: ScheduleComponent,

View File

@ -11,6 +11,7 @@ var scheduleFormTmpl = require('./schedule.form.tmpl.html'),
scheduleDeleteTmpl = require('./schedule.delete.tmpl.html'); scheduleDeleteTmpl = require('./schedule.delete.tmpl.html');
export class ScheduleComponent { export class ScheduleComponent {
$modal: any;
accountId: number; accountId: number;
operations = []; operations = [];
@ -18,7 +19,6 @@ export class ScheduleComponent {
private toastrService: ToastrService, private toastrService: ToastrService,
private scheduleService: ScheduleService, private scheduleService: ScheduleService,
private logger: Logger, private logger: Logger,
private $modal
) {} ) {}
$onInit() { $onInit() {