Skip to content

Instantly share code, notes, and snippets.

@bruno-campos
bruno-campos / autoresize.ts
Last active August 22, 2018 14:23 — forked from maxt3r/autoresize.ts
Ionic 2 ion-textarea autoresize
// An autoresize directive that works with ion-textarea in Ionic 2
// Usage example: <ion-textarea autoresize [(ngModel)]="body"></ion-textarea>
// Based on https://www.npmjs.com/package/angular2-autosize
import { Directive, HostListener, ElementRef, Input } from '@angular/core';
@Directive({
selector: 'ion-textarea[autoresize]'
})
export class AutoresizeDirective {