From 7b7f72bf1ea32f6aab50e368986aa45518c18301 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 23 Jul 2017 07:58:41 +0200 Subject: [PATCH] Inject $modal from router. --- src/app.config.ts | 3 +++ src/scheduler/index.ts | 3 ++- src/scheduler/schedule.component.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app.config.ts b/src/app.config.ts index d9d521e..035c0d7 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -24,6 +24,9 @@ export default function AppConfig($uiRouterProvider) { resolve: { accountId: function($transition$) { return $transition$.params().accountId; + }, + $modal: function($modal) { + return $modal; } } }); diff --git a/src/scheduler/index.ts b/src/scheduler/index.ts index fb0a8cb..e1b6835 100644 --- a/src/scheduler/index.ts +++ b/src/scheduler/index.ts @@ -49,7 +49,8 @@ export default angular.module('accountant.scheduler', [ .component('scheduleComponent', { bindings: { - accountId: '<' + accountId: '<', + $modal: '<' }, templateUrl: schedulerTmpl, controller: ScheduleComponent, diff --git a/src/scheduler/schedule.component.ts b/src/scheduler/schedule.component.ts index f2fc90c..1b467f3 100644 --- a/src/scheduler/schedule.component.ts +++ b/src/scheduler/schedule.component.ts @@ -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() {