increase textarea size according to the size of the text in the angular

sorry for my English

currently the following code is being used to resize the textarea

    function autoResize(el){
  while (el.scrollHeight > el.offsetHeight){
    el.rows += 1;
  }
}

but it only resizes when I hover over the textarea

<textarea onmousemove="autoResize(this)"></textarea>

I would like to make it resize automatically when I open the screen that has the textarea. I already tried switching to onload but without success