UNPKG

ionic4-reactive-textarea

Version:
64 lines (48 loc) 1.25 kB
# ionic4-reactive-textarea Angular auto-resize text-area directive ============= ionic4-reactive-textarea is an Angular directive that automatically resize the height of text-area to fit the content. ![alt text](assets/reactive-textarea.gif "Reactive text-area") Installation ----------------- To use with node: ```console npm install ionic4-reactive-textarea ``` Usage ----------------- import in `module.ts` file ```typescript import { ReactiveTextAreaDirectiveModule } from 'ionic4-reactive-textarea'; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, ReactiveTextAreaDirectiveModule, RouterModule.forChild([ { path: '', component: HomePage, }, ]), ], }) ``` and then in `html` template ```html <ion-header> <ion-toolbar> <ion-title> Reactive Textarea </ion-title> </ion-toolbar> </ion-header> <ion-content padding> <ion-textarea reactive="100"> </ion-textarea> </ion-content> ``` Acknowledgements ----------------- Inspired from Steve Papa's [angular2-autosize](https://github.com/stevepapa/angular2-autosize) and flivni's [ionic2-autosize](https://github.com/flivni/ionic2-autosize)