Sharing Top Content from the Angular-sphere.

angularjs-autogrow (0.2.0): AngularJS 1.x directive for auto-grow / auto-resize of textarea …

  • AngularJS directive for auto-grow / auto-resize of textarea elements on typing.
  • Include file in section of the HTML:

    It’s also recommended to add those two CSS properties to make things stable:

    Add the directive to the textarea element:

    You can limit the auto-growing of the textarea element by using attribute:

    You can set the initial line number using attribute:

AngularJS 1.x directive for auto-grow / auto-resize of textarea elements

@nodenpm: angularjs-autogrow (0.2.0): AngularJS 1.x directive for auto-grow / auto-resize of textarea …

Works in all cases: expands on line breaks and word breaks.

Great Performance: minimal DOM manipulation and no watchers.

Allows limitation of auto-growing so a scrollbar will appear after X lines of content.

section of the HTML:

dependency in your angular module:

It’s also recommended to add those two CSS properties to make things stable:

Add the directive to the textarea element:

< textarea   autogrow > < / textarea >

attribute:

< textarea   autogrow   max-lines = " 3 " > < / textarea >

attribute:

< textarea   autogrow   rows = " 1 " > < / textarea >

Manage developer teams with varying permissions and multiple projects. Learn more about Private Packages and Organizations…

angularjs-autogrow

Comments are closed, but trackbacks and pingbacks are open.