# ng2-smart-autocomplete

> This is a simple example Angular Library published to npm.

Latest version **1.0.14** (published 2018-10-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install ng2-smart-autocomplete
pnpm add ng2-smart-autocomplete
yarn add ng2-smart-autocomplete
bun add ng2-smart-autocomplete
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2018-10-26 |
| First published | 2018-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 227.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yodawang |
| Maintainers | yodawang |
| Keywords | Angular, Library, ng2, autocomplete, tags input, multi-select |

## Links

- npm: https://www.npmjs.com/package/ng2-smart-autocomplete
- Repository: https://github.com/kuroky360/ng2-smart-autocomplete
- Homepage: https://github.com/kuroky360/ng2-smart-autocomplete#readme
- Issues: https://github.com/kuroky360/ng2-smart-autocomplete/issues
- npm.io page: https://npm.io/package/ng2-smart-autocomplete

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 1.0.14 (latest) — 2018-10-26
- 1.0.13 — 2018-10-26
- 1.0.12 — 2018-10-25
- 1.0.11 — 2018-10-25
- 1.0.10 — 2018-10-25
- 1.0.9 — 2018-10-23
- 1.0.8 — 2018-10-22
- 1.0.7 — 2018-10-22
- 1.0.6 — 2018-10-22
- 1.0.5 — 2018-10-22
- 1.0.4 — 2018-10-22
- 1.0.3 — 2018-10-22
- 1.0.2 — 2018-10-22
- 1.0.1 — 2018-10-22
- 1.0.0 — 2018-10-22
- … 1 more at https://npm.io/package/ng2-smart-autocomplete/versions

## README

# Ng2-Smart-AutoComplete

[![Build Status](https://travis-ci.org/kuroky360/ng2-smart-autocomplete.svg?branch=master)](https://travis-ci.org/kuroky360/ng2-smart-autocomplete) [![npm](https://img.shields.io/npm/dt/ng2-smart-autocomplete.svg)](https://www.npmjs.com/package/ng2-smart-autocomplete)  [![npm](https://img.shields.io/npm/v/ng2-smart-autocomplete.svg)](https://www.npmjs.com/package/ng2-smart-autocomplete) [![NpmLicense](https://img.shields.io/npm/l/ng2-smart-autocomplete.svg)](https://www.npmjs.com/package/ng2-smart-autocomplete)

![ng2-smart-autocomplete-demo](preview.gif)


## What is ng2-smart-autocomplete?
   ng2-smart-autocomplete is a Angular Library which allows the visitor to select an item from a Real-time pull dropdown list when typing something into an input field. Similar to the autocomplete, typeahead and tags input plugins.

## Features
  * Lightweight
  * Tag input
  * Keyboard shortcuts
  * Dynamic drop-down lists 

## Install

```sh
 $ npm install ng2-smart-autocomplete --save
```

## Usage
  
  1、import Ng2SmartAutocompleteModule to your AppModule
  
  ```sh
   import { Ng2SmartAutocompleteModule } from 'ng2-smart-autocomplete';
   
   @NgModule({
     declarations: [
       AppComponent
     ],
     imports: [
       BrowserModule,
       Ng2SmartAutocompleteModule
     ],
     providers: [],
     bootstrap: [AppComponent]
   })
   export class AppModule { }
  ```  
  
  2、use it in your template
  
    <smart-autocomplete [displayData]="myDisplayData" [fetchData]="myFetchData" (fetchMethod)="myFetchMethod($event)"></smart-autocomplete>

## Attributes

 * **`displayData`**, array, required. Used to save the currently selected data list. Expect such a data format  [ {id:'xx',name:'xx'},... ]
 * **`fetchData`**, array, required. Data source array,used to save the current real-time pull data list. Expect such a data format [ {id:'xx',name:'xx'},... ]
 * **`maxCount`**, number, optional. The maximum number of selected data lists, the default number is unlimited
 * **`en`**, boolean, optional. If true, the English template is used, otherwise the Chinese template is used, the default is false
 * **`fetchMethod`**, fn, required. Real-time data pull method, receiving a keyword parameter（$event）(It should be noted that **`fetchData`** should be updated after the data is obtained)
                        
## For Developers

  ```sh
  $ git clone https://github.com/kuroky360/ng2-smart-autocomplete.git
  $ cd ng2-smart-autocomplete
  $ npm install
  $ npm start
  ```
### List of available npm tasks

   * `npm run package` : build and package project

---
_Source: https://npm.io/package/ng2-smart-autocomplete · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
