0
rvanwoezik created
ASP.NET CORE & Angular (single solution) .NET 5.0 v10.2.0
I want to bind the style background image to angular model by:
<div class="image-input image-input-empty image-input-outline" id="kt_user_edit_avatar" [style.background-image]="'url(' + course.courseImageUrl + ')'">
But it doesn't show the image, when i use:
<img [src]="course.courseImageUrl"/>
the image is visible
Image is set by this:
setCourseImageUrl(course: CourseListDto): void {
this._localStorageService.getItem(AppConsts.authorization.encrptedAuthTokenName,
function(err, value) {
let courseImageUrl = AppConsts.remoteServiceBaseUrl +
'/Course/GetCourseImageByCourse?courseId=' +
course.id +
'&' +
AppConsts.authorization.encrptedAuthTokenName +
'=' +
encodeURIComponent(value.token);
(course as any).courseImageUrl = courseImageUrl;
});
}
1 Answer(s)
-
0
Hi @rvanwoezik
This is not related to AspNet Zero but I think you should provide dimensions (width, height) to the related div.