It's a special angular directive that autoresize a textarea based on the content. Autoresize is triggered on:
Try it yourself:
npm installnpm run start for a dev serverhttp://localhost:4200/Run npm i @danielzotti/ng-textarea-autoresize --save
Import NgTextareaAutoresizeModule from @danielzotti/ng-textarea-autoresize in app.module.ts
import { BrowserModule } from "@angular/platform-browser"; import { NgModule } from "@angular/core"; import { NgTextareaAutoresizeModule } from "@danielzotti/ng-textarea-autoresize"; import { AppComponent } from "./app.component"; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, NgFilemanagerModule], providers: [], bootstrap: [AppComponent] }) export class AppModule {}
<textarea autoresize></textarea>
autoresizeMaxHeight attribute<textarea autoresize autoresizeMaxHeight="150"></textarea>
autoresize attributeautoresizeMaxHeight attribute<textarea [autoresize]="text" [autoresizeMaxHeight]="maxHeight"></textarea>
import { Component } from "@angular/core"; @Component({ selector: "app-root", templateUrl: "./app.component.html", styleUrls: ["./app.component.scss"] }) export class AppComponent { maxHeight = 150; // pixels text = "This is the text for the textarea!"; }