@osovitny/anatoly 2.0.22 → 2.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/bundles/osovitny-anatoly.umd.js +381 -233
  2. package/bundles/osovitny-anatoly.umd.js.map +1 -1
  3. package/bundles/osovitny-anatoly.umd.min.js +2 -2
  4. package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
  5. package/esm2015/lib/core/localization/localization.service.js +115 -0
  6. package/esm2015/lib/core/utils.js +58 -14
  7. package/esm2015/lib/ui/index.js +4 -4
  8. package/esm2015/lib/ui/ui.module.js +25 -25
  9. package/esm2015/lib/ui/validation/form-validation-summary.component.js +64 -0
  10. package/esm2015/lib/ui/validation/item-validation-summary.component.js +38 -0
  11. package/esm2015/lib/ui/validation/validation-summary.component.js +117 -0
  12. package/fesm2015/osovitny-anatoly.js +327 -182
  13. package/fesm2015/osovitny-anatoly.js.map +1 -1
  14. package/lib/core/localization/localization.service.d.ts +18 -0
  15. package/lib/core/utils.d.ts +9 -0
  16. package/lib/ui/index.d.ts +3 -3
  17. package/lib/ui/ui.module.d.ts +2 -2
  18. package/lib/ui/{components/validation → validation}/validation-summary.component.d.ts +1 -1
  19. package/osovitny-anatoly.metadata.json +1 -1
  20. package/package.json +1 -1
  21. package/esm2015/lib/ui/components/validation/form-validation-summary.component.js +0 -64
  22. package/esm2015/lib/ui/components/validation/item-validation-summary.component.js +0 -38
  23. package/esm2015/lib/ui/components/validation/validation-summary.component.js +0 -117
  24. /package/lib/ui/{components/validation → validation}/form-validation-summary.component.d.ts +0 -0
  25. /package/lib/ui/{components/validation → validation}/item-validation-summary.component.d.ts +0 -0
@@ -1,10 +1,11 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('sweetalert2'), require('uuid'), require('@angular/core'), require('@angular/router'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('@angular/common'), require('@angular/forms'), require('angular-froala-wysiwyg')) :
3
- typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', 'sweetalert2', 'uuid', '@angular/core', '@angular/router', '@angular/common/http', 'rxjs/operators', 'rxjs', '@angular/common', '@angular/forms', 'angular-froala-wysiwyg'], factory) :
4
- (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.Swal, global.uuid, global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.rxjs, global.ng.common, global.ng.forms, global.angularFroalaWysiwyg));
5
- }(this, (function (exports, Swal, uuid, i0, router, http, operators, rxjs, common, forms, angularFroalaWysiwyg) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('sweetalert2'), require('@angular/core'), require('@ngx-translate/core'), require('date-fns'), require('date-fns/locale/en-US'), require('@angular/common'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('uuid'), require('@angular/router'), require('@angular/forms'), require('angular-froala-wysiwyg')) :
3
+ typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', 'sweetalert2', '@angular/core', '@ngx-translate/core', 'date-fns', 'date-fns/locale/en-US', '@angular/common', '@angular/common/http', 'rxjs/operators', 'rxjs', 'uuid', '@angular/router', '@angular/forms', 'angular-froala-wysiwyg'], factory) :
4
+ (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.Swal, global.ng.core, global.i1, global.dateFns, global.enUS, global.ng.common, global.ng.common.http, global.rxjs.operators, global.rxjs, global.uuid, global.ng.router, global.ng.forms, global.angularFroalaWysiwyg));
5
+ }(this, (function (exports, Swal, i0, i1, dateFns, enUS, common, http, operators, rxjs, uuid, router, forms, angularFroalaWysiwyg) { 'use strict';
6
6
 
7
7
  Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
8
+ enUS = enUS && Object.prototype.hasOwnProperty.call(enUS, 'default') ? enUS['default'] : enUS;
8
9
 
9
10
  /*
10
11
  <file>
@@ -227,7 +228,7 @@
227
228
  Anatoly Osovitny
228
229
 
229
230
  Created:
230
- 26 Jun 2020
231
+ 05 May 2020
231
232
 
232
233
  Version:
233
234
  1.0
@@ -235,221 +236,89 @@
235
236
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
236
237
  </file>
237
238
  */
238
- var Utils = /** @class */ (function () {
239
- function Utils() {
239
+ var LocalizationService = /** @class */ (function () {
240
+ function LocalizationService(translate) {
241
+ this.translate = translate;
242
+ this.setSupportedLanguages(['en']);
240
243
  }
241
- Utils.getValueByNameInQS = function (name) {
242
- return Utils.getValueByName(location.search, name);
244
+ LocalizationService.prototype.format = function (str, args) {
245
+ // tslint:disable-next-line:variable-name
246
+ return str.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] !== 'undefined' ? args[number] : match; });
247
+ };
248
+ ;
249
+ LocalizationService.prototype.configureTranslationSettings = function (translate) {
250
+ var languageToSet = 'en';
251
+ translate.setDefaultLang(languageToSet);
252
+ return languageToSet;
253
+ };
254
+ LocalizationService.prototype.getBrowserLanguage = function () {
255
+ return this.translate.getBrowserLang();
256
+ };
257
+ LocalizationService.prototype.getDatefnsLocale = function () {
258
+ var dfnLocale;
259
+ switch (this.getBrowserLanguage()) {
260
+ case 'en':
261
+ dfnLocale = { locale: enUS };
262
+ break;
263
+ default:
264
+ dfnLocale = { locale: enUS };
265
+ }
266
+ return dfnLocale;
243
267
  };
244
- Utils.getValueByName = function (url, name) {
245
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
246
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(url);
247
- return results === null
248
- ? ""
249
- : decodeURIComponent(results[1].replace(/\+/g, " "));
268
+ LocalizationService.prototype.setDefaultLanguage = function (lang) {
269
+ this.translate.setDefaultLang(lang);
250
270
  };
251
- Utils.copyToClipBoard = function (event, val) {
252
- event.preventDefault();
253
- var selBox = document.createElement("textarea");
254
- selBox.style.position = "fixed";
255
- selBox.style.left = "0";
256
- selBox.style.top = "0";
257
- selBox.style.opacity = "0";
258
- selBox.value = val;
259
- document.body.appendChild(selBox);
260
- selBox.focus();
261
- selBox.select();
262
- document.execCommand("copy");
263
- document.body.removeChild(selBox);
271
+ LocalizationService.prototype.setSupportedLanguages = function (languages) {
272
+ this.translate.addLangs(languages);
264
273
  };
265
- Utils.downloadFile = function (name, url) {
266
- var link = document.createElement("a");
267
- link.download = name;
268
- link.href = url;
269
- link.click();
274
+ LocalizationService.prototype.updateLanguage = function (language) {
275
+ this.translate.use(language);
270
276
  };
271
- return Utils;
272
- }());
273
-
274
- /*
275
- <file>
276
- Project:
277
- @osovitny/anatoly
278
-
279
- Authors:
280
- Vadim Osovitny
281
- Anatoly Osovitny
282
-
283
- Created:
284
- 26 Jun 2020
285
-
286
- Version:
287
- 1.0
288
-
289
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
290
- </file>
291
- */
292
- var Subs = /** @class */ (function () {
293
- function Subs() {
294
- this.subs = [];
295
- }
296
- Subs.prototype.add = function () {
297
- var subscriptions = [];
298
- for (var _i = 0; _i < arguments.length; _i++) {
299
- subscriptions[_i] = arguments[_i];
277
+ LocalizationService.prototype.getLocalizedValue = function (key, params) {
278
+ var value = this.translate.instant(key);
279
+ if (!params || params.length === 0) {
280
+ return value;
300
281
  }
301
- this.subs = this.subs.concat(subscriptions);
302
- };
303
- Object.defineProperty(Subs.prototype, "sink", {
304
- set: function (subscription) {
305
- this.subs.push(subscription);
306
- },
307
- enumerable: false,
308
- configurable: true
309
- });
310
- Subs.prototype.unsubscribe = function () {
311
- this.subs.forEach(function (sub) { return sub && sub.unsubscribe(); });
312
- this.subs = [];
282
+ return this.format(value, params);
313
283
  };
314
- return Subs;
315
- }());
316
-
317
- /*
318
- <file>
319
- Project:
320
- @osovitny/anatoly
321
-
322
- Authors:
323
- Vadim Osovitny
324
- Anatoly Osovitny
325
-
326
- Created:
327
- 26 Jun 2020
328
-
329
- Version:
330
- 1.0
331
-
332
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
333
- </file>
334
- */
335
- var Guid = /** @class */ (function () {
336
- function Guid() {
337
- }
338
- Guid.newGuid = function () {
339
- return uuid.v4();
340
- };
341
- return Guid;
342
- }());
343
-
344
- /*
345
- <file>
346
- Project:
347
- @osovitny/anatoly
348
-
349
- Authors:
350
- Vadim Osovitny
351
- Anatoly Osovitny
352
-
353
- Created:
354
- 17 Jun 2018
355
-
356
- Version:
357
- 1.0
358
-
359
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
360
- </file>
361
- */
362
- var BaseGoService = /** @class */ (function () {
363
- function BaseGoService(route, router) {
364
- this.route = route;
365
- this.router = router;
366
- }
367
- BaseGoService.prototype.locationReload = function () {
368
- //this.router.navigate([this.route.url]);
369
- window.location.reload();
284
+ LocalizationService.prototype.getLocalizedDate = function (key) {
285
+ if (dateFns.isValid(new Date(key))) {
286
+ return dateFns.format(new Date(key), AppCoreSettings.DATE_FORMATS.angular, this.dateFnsLocale);
287
+ }
288
+ return 'Invalid Date';
289
+ };
290
+ LocalizationService.prototype.getLocalizedDateTime = function (key) {
291
+ // To Do Manoj: Test in IE and make TimeZone specific changes accordingly
292
+ var dateValue = new Date(key);
293
+ if (dateFns.isValid(dateValue)) {
294
+ var localDate = Utils.convertToLocalizedDateTime(dateValue);
295
+ return dateFns.format(localDate, AppCoreSettings.DATE_FORMATS.angularWithTime, this.dateFnsLocale);
296
+ }
297
+ return 'Invalid Date';
370
298
  };
371
- return BaseGoService;
372
- }());
373
- BaseGoService.decorators = [
374
- { type: i0.Injectable }
375
- ];
376
- BaseGoService.ctorParameters = function () { return [
377
- { type: router.ActivatedRoute },
378
- { type: router.Router }
379
- ]; };
380
-
381
- /*
382
- <file>
383
- Project:
384
- @osovitny/anatoly
385
-
386
- Authors:
387
- Vadim Osovitny
388
- Anatoly Osovitny
389
-
390
- Created:
391
- 26 Jun 2020
392
-
393
- Version:
394
- 1.0
395
-
396
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
397
- </file>
398
- */
399
- var LoggingService = /** @class */ (function () {
400
- function LoggingService() {
401
- }
402
- LoggingService.prototype.logError = function (error) {
403
- console.error(error);
299
+ LocalizationService.prototype.getLocalizedDistanceToNowInWords = function (date) {
300
+ // https://date-fns.org/v1.30.1/docs/distanceInWords
301
+ if (dateFns.isValid(new Date(date))) {
302
+ return dateFns.formatDistanceToNow(new Date(date), this.dateFnsLocale);
303
+ }
304
+ return 'Invalid Date';
404
305
  };
405
- LoggingService.prototype.logInformation = function (info) {
406
- console.info(info);
306
+ LocalizationService.prototype.getLocalizedDistanceInWords = function (endedDate, startedDate) {
307
+ if (dateFns.isValid(new Date(endedDate)) && dateFns.isValid(new Date(startedDate))) {
308
+ return dateFns.formatDistance(new Date(endedDate), new Date(startedDate), this.dateFnsLocale);
309
+ }
310
+ return 'Invalid Date';
407
311
  };
408
- return LoggingService;
312
+ return LocalizationService;
409
313
  }());
410
- LoggingService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoggingService_Factory() { return new LoggingService(); }, token: LoggingService, providedIn: "root" });
411
- LoggingService.decorators = [
314
+ LocalizationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LocalizationService_Factory() { return new LocalizationService(i0.ɵɵinject(i1.TranslateService)); }, token: LocalizationService, providedIn: "root" });
315
+ LocalizationService.decorators = [
412
316
  { type: i0.Injectable, args: [{
413
- providedIn: "root",
317
+ providedIn: 'root'
414
318
  },] }
415
319
  ];
416
- LoggingService.ctorParameters = function () { return []; };
417
-
418
- /*
419
- <file>
420
- Project:
421
- @osovitny/anatoly
422
-
423
- Authors:
424
- Vadim Osovitny
425
- Anatoly Osovitny
426
-
427
- Created:
428
- 26 Jun 2020
429
-
430
- Version:
431
- 1.0
432
-
433
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
434
- </file>
435
- */
436
- var GlobalErrorHandler = /** @class */ (function () {
437
- function GlobalErrorHandler(injector) {
438
- this.injector = injector;
439
- }
440
- GlobalErrorHandler.prototype.handleError = function (error) {
441
- var loggingService = this.injector.get(LoggingService);
442
- loggingService.logError(error);
443
- // IMPORTANT: Rethrow the error otherwise it gets swallowed
444
- throw error;
445
- };
446
- return GlobalErrorHandler;
447
- }());
448
- GlobalErrorHandler.decorators = [
449
- { type: i0.Injectable }
450
- ];
451
- GlobalErrorHandler.ctorParameters = function () { return [
452
- { type: i0.Injector }
320
+ LocalizationService.ctorParameters = function () { return [
321
+ { type: i1.TranslateService }
453
322
  ]; };
454
323
 
455
324
  /*! *****************************************************************************
@@ -753,6 +622,43 @@
753
622
  return value;
754
623
  }
755
624
 
625
+ /*
626
+ <file>
627
+ Project:
628
+ @osovitny/anatoly
629
+
630
+ Authors:
631
+ Vadim Osovitny
632
+ Anatoly Osovitny
633
+
634
+ Created:
635
+ 26 Jun 2020
636
+
637
+ Version:
638
+ 1.0
639
+
640
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
641
+ </file>
642
+ */
643
+ var LoggingService = /** @class */ (function () {
644
+ function LoggingService() {
645
+ }
646
+ LoggingService.prototype.logError = function (error) {
647
+ console.error(error);
648
+ };
649
+ LoggingService.prototype.logInformation = function (info) {
650
+ console.info(info);
651
+ };
652
+ return LoggingService;
653
+ }());
654
+ LoggingService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoggingService_Factory() { return new LoggingService(); }, token: LoggingService, providedIn: "root" });
655
+ LoggingService.decorators = [
656
+ { type: i0.Injectable, args: [{
657
+ providedIn: "root",
658
+ },] }
659
+ ];
660
+ LoggingService.ctorParameters = function () { return []; };
661
+
756
662
  /*
757
663
  <file>
758
664
  Project:
@@ -940,6 +846,273 @@
940
846
  ];
941
847
  LoadingService.ctorParameters = function () { return []; };
942
848
 
849
+ var providers = [
850
+ LoggingService,
851
+ AppContextService,
852
+ LoadingService
853
+ ];
854
+ var InjectorInstance;
855
+ var AnatolyCoreModule = /** @class */ (function () {
856
+ function AnatolyCoreModule(injector, parentModule) {
857
+ this.injector = injector;
858
+ throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
859
+ InjectorInstance = this.injector;
860
+ }
861
+ return AnatolyCoreModule;
862
+ }());
863
+ AnatolyCoreModule.decorators = [
864
+ { type: i0.NgModule, args: [{
865
+ imports: [common.CommonModule],
866
+ providers: __spread(providers),
867
+ },] }
868
+ ];
869
+ AnatolyCoreModule.ctorParameters = function () { return [
870
+ { type: i0.Injector },
871
+ { type: AnatolyCoreModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
872
+ ]; };
873
+
874
+ /*
875
+ <file>
876
+ Project:
877
+ @osovitny/anatoly
878
+
879
+ Authors:
880
+ Vadim Osovitny
881
+ Anatoly Osovitny
882
+
883
+ Created:
884
+ 19 March 2020
885
+
886
+ Version:
887
+ 1.0
888
+
889
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
890
+ </file>
891
+ */
892
+ // @dynamic
893
+ var Utils = /** @class */ (function () {
894
+ function Utils() {
895
+ }
896
+ Utils.getValueByNameInQS = function (name) {
897
+ return Utils.getValueByName(location.search, name);
898
+ };
899
+ Utils.getValueByName = function (url, name) {
900
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
901
+ var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
902
+ return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
903
+ };
904
+ Utils.copyToClipBoard = function (event, val) {
905
+ event.preventDefault();
906
+ var selBox = document.createElement('textarea');
907
+ selBox.style.position = 'fixed';
908
+ selBox.style.left = '0';
909
+ selBox.style.top = '0';
910
+ selBox.style.opacity = '0';
911
+ selBox.value = val;
912
+ document.body.appendChild(selBox);
913
+ selBox.focus();
914
+ selBox.select();
915
+ document.execCommand('copy');
916
+ document.body.removeChild(selBox);
917
+ };
918
+ Utils.downloadFile = function (name, url) {
919
+ var link = document.createElement('a');
920
+ link.download = name;
921
+ link.href = url;
922
+ link.click();
923
+ };
924
+ Object.defineProperty(Utils, "localizationService", {
925
+ // Localization
926
+ // @dynamic
927
+ get: function () {
928
+ var ns = InjectorInstance.get(LocalizationService);
929
+ return ns;
930
+ },
931
+ enumerable: false,
932
+ configurable: true
933
+ });
934
+ Utils.getLocalizedValue = function (key, params, defaultKey) {
935
+ // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
936
+ // defaultKey definition:
937
+ // if key is empty and defaultKey is defined => get localization for defaultKey
938
+ // Example: cancel()
939
+ if (!key && defaultKey) {
940
+ return this.localizationService.getLocalizedValue(defaultKey);
941
+ }
942
+ // VadimOS:
943
+ // if key is not empty value MUST be in localization table, othewise we will return key
944
+ if (key) {
945
+ var value = this.localizationService.getLocalizedValue(key, params);
946
+ return value;
947
+ }
948
+ return key;
949
+ };
950
+ /**
951
+ * Convert date time lo local time zone value.
952
+ * @param value
953
+ */
954
+ Utils.convertToLocalizedDateTime = function (value) {
955
+ if (value) {
956
+ return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
957
+ }
958
+ return null;
959
+ };
960
+ Utils.downloadBlobFile = function (value, fileName) {
961
+ if (window.navigator.msSaveOrOpenBlob) {
962
+ window.navigator.msSaveOrOpenBlob(value, fileName);
963
+ }
964
+ else {
965
+ var downloadURL = window.URL.createObjectURL(value);
966
+ Utils.downloadFile(fileName, downloadURL);
967
+ }
968
+ };
969
+ return Utils;
970
+ }());
971
+
972
+ /*
973
+ <file>
974
+ Project:
975
+ @osovitny/anatoly
976
+
977
+ Authors:
978
+ Vadim Osovitny
979
+ Anatoly Osovitny
980
+
981
+ Created:
982
+ 26 Jun 2020
983
+
984
+ Version:
985
+ 1.0
986
+
987
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
988
+ </file>
989
+ */
990
+ var Subs = /** @class */ (function () {
991
+ function Subs() {
992
+ this.subs = [];
993
+ }
994
+ Subs.prototype.add = function () {
995
+ var subscriptions = [];
996
+ for (var _i = 0; _i < arguments.length; _i++) {
997
+ subscriptions[_i] = arguments[_i];
998
+ }
999
+ this.subs = this.subs.concat(subscriptions);
1000
+ };
1001
+ Object.defineProperty(Subs.prototype, "sink", {
1002
+ set: function (subscription) {
1003
+ this.subs.push(subscription);
1004
+ },
1005
+ enumerable: false,
1006
+ configurable: true
1007
+ });
1008
+ Subs.prototype.unsubscribe = function () {
1009
+ this.subs.forEach(function (sub) { return sub && sub.unsubscribe(); });
1010
+ this.subs = [];
1011
+ };
1012
+ return Subs;
1013
+ }());
1014
+
1015
+ /*
1016
+ <file>
1017
+ Project:
1018
+ @osovitny/anatoly
1019
+
1020
+ Authors:
1021
+ Vadim Osovitny
1022
+ Anatoly Osovitny
1023
+
1024
+ Created:
1025
+ 26 Jun 2020
1026
+
1027
+ Version:
1028
+ 1.0
1029
+
1030
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1031
+ </file>
1032
+ */
1033
+ var Guid = /** @class */ (function () {
1034
+ function Guid() {
1035
+ }
1036
+ Guid.newGuid = function () {
1037
+ return uuid.v4();
1038
+ };
1039
+ return Guid;
1040
+ }());
1041
+
1042
+ /*
1043
+ <file>
1044
+ Project:
1045
+ @osovitny/anatoly
1046
+
1047
+ Authors:
1048
+ Vadim Osovitny
1049
+ Anatoly Osovitny
1050
+
1051
+ Created:
1052
+ 17 Jun 2018
1053
+
1054
+ Version:
1055
+ 1.0
1056
+
1057
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1058
+ </file>
1059
+ */
1060
+ var BaseGoService = /** @class */ (function () {
1061
+ function BaseGoService(route, router) {
1062
+ this.route = route;
1063
+ this.router = router;
1064
+ }
1065
+ BaseGoService.prototype.locationReload = function () {
1066
+ //this.router.navigate([this.route.url]);
1067
+ window.location.reload();
1068
+ };
1069
+ return BaseGoService;
1070
+ }());
1071
+ BaseGoService.decorators = [
1072
+ { type: i0.Injectable }
1073
+ ];
1074
+ BaseGoService.ctorParameters = function () { return [
1075
+ { type: router.ActivatedRoute },
1076
+ { type: router.Router }
1077
+ ]; };
1078
+
1079
+ /*
1080
+ <file>
1081
+ Project:
1082
+ @osovitny/anatoly
1083
+
1084
+ Authors:
1085
+ Vadim Osovitny
1086
+ Anatoly Osovitny
1087
+
1088
+ Created:
1089
+ 26 Jun 2020
1090
+
1091
+ Version:
1092
+ 1.0
1093
+
1094
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1095
+ </file>
1096
+ */
1097
+ var GlobalErrorHandler = /** @class */ (function () {
1098
+ function GlobalErrorHandler(injector) {
1099
+ this.injector = injector;
1100
+ }
1101
+ GlobalErrorHandler.prototype.handleError = function (error) {
1102
+ var loggingService = this.injector.get(LoggingService);
1103
+ loggingService.logError(error);
1104
+ // IMPORTANT: Rethrow the error otherwise it gets swallowed
1105
+ throw error;
1106
+ };
1107
+ return GlobalErrorHandler;
1108
+ }());
1109
+ GlobalErrorHandler.decorators = [
1110
+ { type: i0.Injectable }
1111
+ ];
1112
+ GlobalErrorHandler.ctorParameters = function () { return [
1113
+ { type: i0.Injector }
1114
+ ]; };
1115
+
943
1116
  var AnatolyHttpInterceptor = /** @class */ (function () {
944
1117
  function AnatolyHttpInterceptor(loadingService, loggingService) {
945
1118
  this.loadingService = loadingService;
@@ -1054,31 +1227,6 @@
1054
1227
  { type: LoggingService }
1055
1228
  ]; };
1056
1229
 
1057
- var providers = [
1058
- LoggingService,
1059
- AppContextService,
1060
- LoadingService
1061
- ];
1062
- var InjectorInstance;
1063
- var AnatolyCoreModule = /** @class */ (function () {
1064
- function AnatolyCoreModule(injector, parentModule) {
1065
- this.injector = injector;
1066
- throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1067
- InjectorInstance = this.injector;
1068
- }
1069
- return AnatolyCoreModule;
1070
- }());
1071
- AnatolyCoreModule.decorators = [
1072
- { type: i0.NgModule, args: [{
1073
- imports: [common.CommonModule],
1074
- providers: __spread(providers),
1075
- },] }
1076
- ];
1077
- AnatolyCoreModule.ctorParameters = function () { return [
1078
- { type: i0.Injector },
1079
- { type: AnatolyCoreModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1080
- ]; };
1081
-
1082
1230
  /*
1083
1231
  <file>
1084
1232
  Project:
@@ -2186,7 +2334,7 @@
2186
2334
  HtmlEditorComponent,
2187
2335
  FormsHtmlEditorComponent,
2188
2336
  ContentHeaderComponent,
2189
- //Directives
2337
+ // Directives
2190
2338
  NativeElementDirective
2191
2339
  ],
2192
2340
  declarations: [
@@ -2201,7 +2349,7 @@
2201
2349
  HtmlEditorComponent,
2202
2350
  FormsHtmlEditorComponent,
2203
2351
  ContentHeaderComponent,
2204
- //Directives
2352
+ // Directives
2205
2353
  NativeElementDirective
2206
2354
  ]
2207
2355
  },] }