I want to call a method on change of height of division

is there a way to call a method on change of height of canvas height or any div height

<canvas
      id="canvasContainer"
      #canvasRef
      (mousedown)="handleStartPaint($event)"
      (mouseup)="handleStopPaint()"
      (mousemove)="handleStartPaint($event)"
      (mouseover)="handleCanvasMouseOver()"
      (click)="!isPLayerEditable && togglePlayPause($event)"
    ></canvas>