@bravobit/ngx-autosize
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

ngx-autosize

Autosize your textareas with ease.

npm version npm license

  • Use command + F or ctrl + F to search for a keyword.
  • Contributions welcome, please see contribution guide.

Features

  • Easy implementation
  • Library can be consumed by Angular CLI, Webpack, or SystemJS
  • Compatibility
    • Angular Universal
    • Ahead-Of-Time compilation (AOT)
    • Lazy loading

Demo

Click here to play with the example

Installation

To use ngx-autosize in your project install it via npm or yarn:

$ npm install @bravobit/ngx-autosize --save

# or

$ yarn add @bravobit/ngx-autosize

Setup

Add the NgxAutosizeModule to your imports array in your AppModule.

import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {NgxAutosizeModule} from '@bravobit/ngx-autosize';

import {AppComponent} from './app.component';

@NgModule({
    imports: [BrowserModule, NgxAutosizeModule],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule {
}

Example

import {ChangeDetectionStrategy, Component} from '@angular/core';

@Component({
    selector: 'app-root',
    template: `
        <textarea ngxAutosize
                  minHeight="100px"
                  maxHeight="500px">Woop die floop</textarea>
    `,
    styles: ['textarea { resize: none; }'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent {
}

Readme

Keywords

none

Package Sidebar

Install

npm i @bravobit/ngx-autosize

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

67.8 kB

Total Files

24

Last publish

Collaborators

  • stanvanheumen