You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried it and it didn't happen again.your code should be this.headerImg= this._sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(data)); and make sure data is of type Blob. @kscSoft demo
Version
[email protected]
Angular Version
Angular: 12.2.16
Link to minimal reproduction
component.html
<d-avatar [imgSrc]="headerImg">
component.ts
headerImg;
ngOnInit(): void {
this._http.post(_api, {
keyID: 2,
}, {
responseType: 'blob',
}).subscribe((data) => {
// const _blob = this._sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(data));
const _src = URL.createObjectURL(data);
this.headerImg = _src;
});
}
the headerImg cannot be displayed normally in d-avatar
Step to reproduce
component.html
<d-avatar [imgSrc]="headerImg">
component.ts
headerImg;
ngOnInit(): void {
this._http.post(_api, {
keyID: 2,
}, {
responseType: 'blob',
}).subscribe((data) => {
// const _blob = this._sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(data));
const _src = URL.createObjectURL(data);
this.headerImg = _src;
});
}
the headerImg cannot be displayed normally in d-avatar
What is expected
No response
What is actually happening
No response
Any additional comments (optional)
No response
The text was updated successfully, but these errors were encountered: