@onecx/angular-accelerator 4.14.0 → 4.14.2
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.
- package/esm2020/lib/directives/src.directive.mjs +24 -13
- package/esm2020/lib/services/app-config-service.mjs +3 -2
- package/fesm2015/onecx-angular-accelerator.mjs +24 -13
- package/fesm2015/onecx-angular-accelerator.mjs.map +1 -1
- package/fesm2020/onecx-angular-accelerator.mjs +24 -13
- package/fesm2020/onecx-angular-accelerator.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -150,18 +150,29 @@ class SrcDirective {
|
|
|
150
150
|
}
|
|
151
151
|
set ocxSrc(value) {
|
|
152
152
|
if (value && this._src !== value) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
try {
|
|
154
|
+
if (new URL(value, window.location.origin).origin === window.location.origin) {
|
|
155
|
+
this.httpClient.get(value, { responseType: 'blob' }).subscribe({
|
|
156
|
+
next: (blob) => {
|
|
157
|
+
const url = URL.createObjectURL(blob);
|
|
158
|
+
this.el.nativeElement.onload = () => {
|
|
159
|
+
URL.revokeObjectURL(url);
|
|
160
|
+
};
|
|
161
|
+
this.el.nativeElement.src = url;
|
|
162
|
+
},
|
|
163
|
+
error: () => {
|
|
164
|
+
this.el.nativeElement.src = 'error';
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.el.nativeElement.src = value;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
console.log('Cannot parse URL ', value, error);
|
|
174
|
+
this.el.nativeElement.src = value;
|
|
175
|
+
}
|
|
165
176
|
this._src = value;
|
|
166
177
|
}
|
|
167
178
|
}
|
|
@@ -2878,7 +2889,7 @@ class AppConfigService {
|
|
|
2878
2889
|
}
|
|
2879
2890
|
init(baseUrl) {
|
|
2880
2891
|
return new Promise((resolve, reject) => {
|
|
2881
|
-
const loadConfigPromise = firstValueFrom(this.http.get(baseUrl
|
|
2892
|
+
const loadConfigPromise = firstValueFrom(this.http.get(Location.joinWithSlash(baseUrl, 'assets/env.json')));
|
|
2882
2893
|
loadConfigPromise
|
|
2883
2894
|
.then(async (config) => {
|
|
2884
2895
|
if (config) {
|