@stemy/ngx-utils 19.5.3 → 19.5.5
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.
|
@@ -1949,7 +1949,10 @@ class LoaderUtils {
|
|
|
1949
1949
|
}
|
|
1950
1950
|
static loadElement(src, parent, setup) {
|
|
1951
1951
|
const promises = LoaderUtils.promises;
|
|
1952
|
-
parent = parent || document
|
|
1952
|
+
parent = parent || document;
|
|
1953
|
+
if (parent == document) {
|
|
1954
|
+
parent = document.body;
|
|
1955
|
+
}
|
|
1953
1956
|
let { elem, promise } = promises[src] || {};
|
|
1954
1957
|
if (elem) {
|
|
1955
1958
|
if (parent === elem.parentElement)
|
|
@@ -3426,26 +3429,21 @@ class ErrorHandlerService extends ErrorHandler {
|
|
|
3426
3429
|
this.errorMap = {};
|
|
3427
3430
|
}
|
|
3428
3431
|
handleError(error) {
|
|
3429
|
-
|
|
3430
|
-
this.universal = this.universal || this.injector.get(UniversalService);
|
|
3431
|
-
}
|
|
3432
|
-
catch (e) {
|
|
3433
|
-
return;
|
|
3434
|
-
}
|
|
3432
|
+
this.universal = this.universal || this.injector.get(UniversalService);
|
|
3435
3433
|
const date = new Date();
|
|
3436
3434
|
try {
|
|
3437
3435
|
this.errorCb = this.errorCb || this.injector.get(ERROR_HANDLER);
|
|
3438
3436
|
this.errorCb(`[${date}]: ${error.message}\n${error.stack}`);
|
|
3439
3437
|
}
|
|
3440
3438
|
catch (e) {
|
|
3441
|
-
if (this.universal.isServer) {
|
|
3439
|
+
if (!this.universal || this.universal.isServer) {
|
|
3442
3440
|
console.error(`[${date}]: ${error.message}\n${error.stack}`);
|
|
3443
3441
|
return;
|
|
3444
3442
|
}
|
|
3445
3443
|
}
|
|
3446
|
-
if (this.universal.isServer)
|
|
3444
|
+
if (!this.universal || this.universal.isServer)
|
|
3447
3445
|
return;
|
|
3448
|
-
const key = typeof btoa !== "undefined" ? btoa(
|
|
3446
|
+
const key = typeof btoa !== "undefined" ? btoa(decodeURI(encodeURIComponent(`${error.message} ${error.stack}`))) : error.message;
|
|
3449
3447
|
if (this.errorMap[key] && this.errorMap[key].getTime() > date.getTime() - 5000)
|
|
3450
3448
|
return;
|
|
3451
3449
|
this.errorMap[key] = date;
|