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: {
accountId: function($transition$) {
return $transition$.params().accountId;
},
$modal: function($modal) {
return $modal;
}
}
});

View File

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

View File

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