Autosize https://github.com/jackmoore/autosize/tree/v1

Autosize is a small jQuery plugin to allow dynamic resizing of textarea height, so that it grows as based on visitor input.

Usage


require(['jquery', 'px-libs/jquery.autosize'], function($) {
  ...
});
        

Usage

To use autosize plugin, you need to include the next scripts:


<script src="path/to/js/libs/jquery.autosize.js"></script>
<script src="path/to/js/pixeladmin/directives/angular-autosize.js"></script>
        

Then inject the plugin into your angular application:

angular.module('yourApp', ['angular-autosize']);

Alternatively, you can include autosize plugin using ocLazyLoad plugin:


$ocLazyLoad.load([
  {
    name: 'angular-autosize',
    files: [
      'path/to/js/libs/jquery.autosize.js',
      'path/to/js/pixeladmin/directives/angular-autosize.js',
    ],
  },
]);
        

autosize directive

You can use autosize directive on textarea elements. And when the scope is destroyed the directive will be destroyed.