I have an image (inside a material card) which changes every 30 seconds. I have the height of the image (as a TS variable) and I want to set it as the height of the loaded image. I tried the below approach but I think that the syntax is wrong. What is the right approach?
@Component({
selector: 'app-live',
templateUrl:
<mat-card [ngStyle]="{'min-height': '{{taille}}'}">
<img mat-card-image [src]="profileUrl | async " alt="Streaming de la culture" #img [ngStyle]="{'padding-top':'0px' }" (load)="dosomething(img)">
</mat-card>
export class LiveComponent implements OnInit {
taille;
dosomething(img) { console.log(img.clientWidth, img.clientHeight);
this.taille = img.clientHeight;
console.log(this.taille);}
{{and}}'{{and}}'aroundtaille