@danielzotti/ng-textarea-autoresize

It works with <textarea> and it auto-resizes its height on:

simple

<textarea autoresize></textarea>

max height = 150px

<textarea autoresize autoresizeMaxHeight="150"></textarea>

connection with model

maxHeight: 150

text: "This text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable\nThis text is written in a component variable."

<textarea [autoresize]="text" [autoresizeMaxHeight]="maxHeight"></textarea>

<textarea [autoresize]="text" [autoresizeMaxHeight]="maxHeight" [(ngModel)]="text"></textarea>