ngx-cli-lib-tag-input
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Tag Input for Angular

npm version

This is a component for Angular 2+.

NPM

Getting Started

npm i ngx-cli-lib-tag-input

Configuration

Ensure you import the module and the dependencies:

import { NgxCliLibTagInputModule } from 'ngx-cli-lib-tag-input';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';

@NgModule({
   imports: [
       NgxCliLibTagInputModule, 
       BrowserModule,
       FormsModule,
       ...OtherModules 
   ]
})
export class AppModule {}

Inputs (optional)


tagList - ?string[] - Accepts an array of strings as input.

tagInputValue - [?string] - Value of the input.

separatorsKeyCode - [13, 9, 188] - Array of numbers as keycodes, the default separetors as Tab, Enter and ',' keys.

validationRegex - [?RegExp] - Regex for input validation.

hasError - [false] - Validation result boolean.

allowRepeatedItems - [true] - Allow array repetition.

addOnFocusOut - [true] - Push to array on input focus out.

Output (optional)


OnListChange - [string[]] - Return the current array after value change.

Basic Example

@Component({
    selector: 'app',
    template: `
    <ngx-tag-input 
        [tagList]='items'
        [tagInputValue]='testString'>
    </ngx-tag-inputt>
    `
});
export class App {
    items = ['Pizza', 'Pasta', 'Parmesan'];
    testString= "test";
}
 <ngx-tag-input 
        [tagList]='items'
        [tagInputValue]='testString'>
</ngx-tag-inputt>

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-cli-lib-tag-input

Weekly Downloads

0

Version

0.0.4

License

none

Unpacked Size

109 kB

Total Files

23

Last publish

Collaborators

  • vinicius.n9