13.0.1 • Published 3 years ago

@ngxsmart/autocomplete v13.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Auto Complete

Reusable Auto Complete that extends Mat Auto Complete component

main

Technologies

  1. Angular 12+
  2. Angular Material 12+

Demo

https://stackblitz.com/edit/ngxsmart-autocomplete-demo

Usage

The library has 3 autocomplete components

  1. autocomplete
  2. object-autocomplete
  3. string-autocomplete

To use the Auto Complete components, add the following code to the HTML page

app.component.html

<!-- Generic Auto Complete -->

<form [formGroup] = "inputFormGroup" >
<autocomplete [data] = "cities" [inputFormGroup] = "inputFormGroup" [required] = "true"
bindLabel = "location"
bindValue = "id"
label = "City"
placeHolder = "Select City" > </autocomplete>
  < /form>

app.component.ts

Then define form group instances and object array (cities) and names (for string array)

// Define objects  
cities = [{id: 1001, location: 'New York'}, {id: 1002, location: 'Boston'}, {id: 1001, location: 'Washington DC'}];

// Define Form Groups 
inputFormGroup = this.fb.group({
  autocomplete: ['']
})

For object-autocomplete and string-autocomplete usage see the examples

API

List of selectors that can be used to select the component(s)

AutoComplete Selector
autocomplete, lib-autocomplete
Object AutoComplete Selector
object-autocomplete, lib-object-autocomplete
String AutoComplete Selector
string-autocomplete, lib-string-autocomplete

Properties

PropertyDescriptionTypeDefault Value
inputFormGroupInput Form GroupFormGroup
labelLabel of the AutoCompletestring
placeHolderPlaceHolder of the AutoCompletestring
appearanceAppearance of the AutoComplete, defaults to fillstringfill
classesList of CSS classes that need to applied to autocompletestring
bindLabelApplies only to Generic AutoComplete and Object AutoComplete. Attribute of the Object whose value would be shown when searching for datastringid
bindValueApplies only to Generic AutoComplete and Object AutoComplete. Attribute of the Object whose value would be used for search. Defaults to IDstringid
requiredIs AutoCompletebooleanfalse
dataList of Objects or String values that need to be bind and searched forany[] or string[]false

Publish the library to NPM(applies to maintainers)

  1. Build the library
ng build --configuration production --project=@ngxsmart/autocomplete
  1. Publish the library to NPM
npm publish dist/autocomplete --access public
13.0.0

3 years ago

13.0.1

3 years ago

12.2.1

3 years ago

12.2.2

3 years ago

12.2.0

3 years ago

12.1.1

3 years ago

12.1.0

3 years ago

12.0.0

3 years ago