Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 1.29 KB

README.md

File metadata and controls

62 lines (39 loc) · 1.29 KB

Angular Elastic

Elastic (autosize) textareas for AngularJS, without jQuery dependency.

See it in action.

Usage

as attribute

<textarea msd-elastic ng-model="foo">
  ...
</textarea>

as class

<textarea class="msd-elastic" ng-model="bar">
  ...
</textarea>

optionally append whitespace to the end of the height calculation (an extra newline improves the apperance when animating)

<textarea msd-elastic="\n" ng-model="foo">
  ...
</textarea>

<textarea class="msd-elastic: \n;" ng-model="bar">
  ...
</textarea>

or configure whitespace globally

app.config(['msdElasticConfig', function(config) {
  config.append = '\n\n';
}])

Install

bower install angular-elastic

Include the elastic.js script provided by this component in your app, and add monospaced.elastic to your app’s dependencies.

Support

Modern browsers only—Internet Explorer 6, 7 & 8 retain their default textarea behaviour.

Demo

monospaced.github.io/angular-elastic

Inspiration