GithubHelp home page GithubHelp logo

kuroky360 / ngx-smart-autocomplete Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 245 KB

A lightweight Angular library with integrated tag input, dynamic drop-down lists, and fuzzy search capabilities, support keyboard shortcuts

License: MIT License

JavaScript 6.10% TypeScript 30.01% HTML 6.32% CSS 5.07% JavaScript 6.39% TypeScript 34.90% HTML 5.62% CSS 0.35% Less 5.23%
autocomplete angular-library keyboard-shortcuts tags-input multi-select

ngx-smart-autocomplete's Introduction

Ngx-Smart-AutoComplete

Build Status npm npm NpmLicense

ng2-smart-autocomplete-demo

What is ngx-smart-autocomplete?

ngx-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

 $ npm install ngx-smart-autocomplete --save

Usage

1、import NgxSmartAutocompleteModule to your AppModule

 import { NgxSmartAutocompleteModule } from 'ngx-smart-autocomplete';
 
 @NgModule({
   declarations: [
     AppComponent
   ],
   imports: [
     BrowserModule,
     NgxSmartAutocompleteModule
   ],
   providers: [],
   bootstrap: [AppComponent]
 })
 export class AppModule { }

2、use it in your template

<smart-autocomplete [displayData]="myDisplayData" [fetchData]="myFetchData" (fetchMethod)="myFetchMethod($event)"></smart-autocomplete>

Attributes

@Input()/@Output() Type Required Default Description
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 unlimited The maximum number of selected data lists, the default number is unlimited.
en boolean optional false 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

$ git clone https://github.com/kuroky360/ngx-smart-autocomplete.git
$ cd ngx-smart-autocomplete
$ npm install
$ npm start

List of available npm tasks

  • npm run package : build and package project

ngx-smart-autocomplete's People

Contributors

kuroky360 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.