Skip to content

stevepapa/ng-autosize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng-autosize

ng-autosize is an Angular2, Angular4 + directive that automatically adjusts textarea height to fit content.

It adjusts the textarea height automatically to any text input, or changes to the model bound to the textarea.

Demo

http://stevepapa.com/ng-autosize

Installation:

npm install ng-autosize

Use Example:

Add the declaration to your @NgModule:

import {Autosize} from 'ng-autosize';

...

@NgModule({
  declarations: [
    Autosize
  ]
})

Use directly inside your HTML templates by adding the word 'autosize' to any textarea.

<textarea autosize>Hello, this is an example of Autosize in Angular2.</textarea>

Extra Configuration Options:

Set a minimum height on your textarea.

<textarea autosize [minHeight]="60">Hello, this is an example of Autosize in Angular2 with a Min Height.</textarea>

Set a maximum height on your textarea.

<textarea autosize [maxHeight]="120">Hello, this is an example of Autosize in Angular2 with a Max Height.</textarea>

Author

Steve Papa

Licence

This project is licensed under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published