I have a chat feature integrated into my application. I am looking to dynamically resize an image within the chat window when the width of the window falls below a certain threshold. Is there a method available to modify the CSS style or class based on the current width?
My app is built using TypeScript, and I have access to the chat window's width through the following input:
@Input()
public chatWidth: number;
Within my HTML file, I attempted to implement a logic that would add a CSS class if the chatWidth property was less than 400 pixels:
<img *ngIf="upsell?.image?.url; let url" [src]="url" ng-class="{bigger-img : chatWidth < 400}">
However, this approach does not seem to be functioning as intended, and I am not receiving any error messages in my browser console.