Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maddeveloper/ng4-input-counter


https://github.com/maddeveloper/ng4-input-counter

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# ng4-input-counter

A very cool input which display characters counter and can be configured to display counter bounds.

## Normal

![](http://g.recordit.co/VtQnGdw6eX.gif)

## Maxlength

![](http://g.recordit.co/KAVkmjZBxO.gif)

## Minlength

![](http://g.recordit.co/Ww5C5R8B4Z.gif)

## Both

![](http://g.recordit.co/5XUR8OArww.gif)

## Installation

To install the library, run:

```bash
$ npm install ng4-input-counter --save
```

and then from your Angular module

```typescript
import { InputCounterModule } from 'ng4-input-counter';

@NgModule({
...
imports: [
...
InputCounterModule.forRoot()
],
...
})
export class AppModule { }
```

## How to use

```xml


```

### With Bootstrap

```xml





```

## API of input-counter

**`ngModel: any`**

**`id: string`**

**`type: string = 'text'`**

**`className: string`**

> `className` (like the React way) has been used instead of `class` because of it being a reserved keyword in JavaScript and TypeScript.

**`name: string`**

**`placeholder: string = ''`**

**`maxlength: number`**

**`minlength: number`**

**`pattern: string`**

**`disabled: boolean = false`**

**`required: boolean = false`**

**`readonly: boolean = false`**

You can also bind all angular input events handler, like `(focus)`, `(blur)`, `(keyup)`, `(keydown)`, etc.

## License

MIT © [maddeveloper](https://github.com/MadDeveloper)