Showing
3 changed files
with
7 additions
and
1 deletions
@@ -41,6 +41,7 @@ import { CustomDialogService } from '@home/components/widget/dialog/custom-dialo | @@ -41,6 +41,7 @@ import { CustomDialogService } from '@home/components/widget/dialog/custom-dialo | ||
41 | import { DatePipe } from '@angular/common'; | 41 | import { DatePipe } from '@angular/common'; |
42 | import { TranslateService } from '@ngx-translate/core'; | 42 | import { TranslateService } from '@ngx-translate/core'; |
43 | import { DomSanitizer } from '@angular/platform-browser'; | 43 | import { DomSanitizer } from '@angular/platform-browser'; |
44 | +import { Router } from '@angular/router'; | ||
44 | 45 | ||
45 | @Directive() | 46 | @Directive() |
46 | export class DynamicWidgetComponent extends PageComponent implements IDynamicWidgetComponent, OnInit, OnDestroy { | 47 | export class DynamicWidgetComponent extends PageComponent implements IDynamicWidgetComponent, OnInit, OnDestroy { |
@@ -77,6 +78,7 @@ export class DynamicWidgetComponent extends PageComponent implements IDynamicWid | @@ -77,6 +78,7 @@ export class DynamicWidgetComponent extends PageComponent implements IDynamicWid | ||
77 | this.ctx.translate = $injector.get(TranslateService); | 78 | this.ctx.translate = $injector.get(TranslateService); |
78 | this.ctx.http = $injector.get(HttpClient); | 79 | this.ctx.http = $injector.get(HttpClient); |
79 | this.ctx.sanitizer = $injector.get(DomSanitizer); | 80 | this.ctx.sanitizer = $injector.get(DomSanitizer); |
81 | + this.ctx.router = $injector.get(Router); | ||
80 | 82 | ||
81 | this.ctx.$scope = this; | 83 | this.ctx.$scope = this; |
82 | if (this.ctx.defaultSubscription) { | 84 | if (this.ctx.defaultSubscription) { |
@@ -31,6 +31,7 @@ import { CustomerService } from '@core/http/customer.service'; | @@ -31,6 +31,7 @@ import { CustomerService } from '@core/http/customer.service'; | ||
31 | import { DashboardService } from '@core/http/dashboard.service'; | 31 | import { DashboardService } from '@core/http/dashboard.service'; |
32 | import { UserService } from '@core/http/user.service'; | 32 | import { UserService } from '@core/http/user.service'; |
33 | import { AlarmService } from '@core/http/alarm.service'; | 33 | import { AlarmService } from '@core/http/alarm.service'; |
34 | +import { Router } from '@angular/router'; | ||
34 | 35 | ||
35 | export const ServicesMap = new Map<string, Type<any>>( | 36 | export const ServicesMap = new Map<string, Type<any>>( |
36 | [ | 37 | [ |
@@ -49,6 +50,7 @@ export const ServicesMap = new Map<string, Type<any>>( | @@ -49,6 +50,7 @@ export const ServicesMap = new Map<string, Type<any>>( | ||
49 | ['date', DatePipe], | 50 | ['date', DatePipe], |
50 | ['utils', UtilsService], | 51 | ['utils', UtilsService], |
51 | ['translate', TranslateService], | 52 | ['translate', TranslateService], |
52 | - ['http', HttpClient] | 53 | + ['http', HttpClient], |
54 | + ['router', Router] | ||
53 | ] | 55 | ] |
54 | ); | 56 | ); |
@@ -76,6 +76,7 @@ import { TranslateService } from '@ngx-translate/core'; | @@ -76,6 +76,7 @@ import { TranslateService } from '@ngx-translate/core'; | ||
76 | import { PageLink } from '@shared/models/page/page-link'; | 76 | import { PageLink } from '@shared/models/page/page-link'; |
77 | import { SortOrder } from '@shared/models/page/sort-order'; | 77 | import { SortOrder } from '@shared/models/page/sort-order'; |
78 | import { DomSanitizer } from '@angular/platform-browser'; | 78 | import { DomSanitizer } from '@angular/platform-browser'; |
79 | +import { Router } from '@angular/router'; | ||
79 | 80 | ||
80 | export interface IWidgetAction { | 81 | export interface IWidgetAction { |
81 | name: string; | 82 | name: string; |
@@ -157,6 +158,7 @@ export class WidgetContext { | @@ -157,6 +158,7 @@ export class WidgetContext { | ||
157 | translate: TranslateService; | 158 | translate: TranslateService; |
158 | http: HttpClient; | 159 | http: HttpClient; |
159 | sanitizer: DomSanitizer; | 160 | sanitizer: DomSanitizer; |
161 | + router: Router; | ||
160 | 162 | ||
161 | private changeDetectorValue: ChangeDetectorRef; | 163 | private changeDetectorValue: ChangeDetectorRef; |
162 | 164 |