# ng2-yata

> Yet Another Typeahead for Angular2

Latest version **0.1.1** (published 2016-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng2-yata
pnpm add ng2-yata
yarn add ng2-yata
bun add ng2-yata
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-07-24 |
| First published | 2016-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+21 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jason Dana |
| Maintainers | jasondana |
| Keywords | angular, angular2, typeahead, autocomplete, yata |

## Links

- npm: https://www.npmjs.com/package/ng2-yata
- Repository: https://github.com/jasondana/ng2-yata
- Issues: https://github.com/jasondana/ng2-yata/issues
- npm.io page: https://npm.io/package/ng2-yata

## Dependencies (6)

- [rxjs](https://npm.io/package/rxjs.md) 5.0.0-beta.6
- [zone.js](https://npm.io/package/zone.js.md) ^0.6.12
- [@angular/core](https://npm.io/package/@angular/core.md) ^2.0.0-rc.4
- [@angular/forms](https://npm.io/package/@angular/forms.md) ^0.2.0
- [@angular/common](https://npm.io/package/@angular/common.md) ^2.0.0-rc.4
- [@angular/compiler](https://npm.io/package/@angular/compiler.md) ^2.0.0-rc.4

## Recent versions

- 0.1.1 (latest) — 2016-07-24
- 0.1.0 — 2016-07-20

## README

# Yet Another Typeahead for Angular2

A simple typeahead implementation which provides autocompletion of input values
separated by whitespace.

[![Build Status](https://travis-ci.org/jasondana/ng2-yata.svg?branch=master)](https://travis-ci.org/jasondana/ng2-yata)

![demo](http://i.imgur.com/geTk3dk.gif)

## Install

```sh
npm install ng2-yata --save
```

## Usage

```js
import { Component } from '@angular/core';
import { Yata } from 'ng2-yata';

@Component({
  template: `<yata [placeholder]="placeholder"
                   [inputStyle]="inputStyle"
                   [inputStyleClass]="inputStyleClass"
                   [suggestions]="suggestions"
                   [(ngModel)]="filterValue"
                   (onComplete)="onInputComplete($event)></yata>`,
  directives: [ Yata ]
})
export class AppComponent {
  private placeholder: string = 'Enter Text';
  private suggestions: string[] = []; // available suggestions
  private filterValue: string = '';
  private inputStyle = ''; // input element inline css style
  private inputStyleClass = { // input element style classes to apply
    'form-control': true,
    'conditional-style-class': apply
  };
  private apply: boolean = false; // conditionally apply the css class

  onInputComplete(event: any) {
    // Input value accessible through event.value and this.filterValue
    // Find suggestions and populate suggestions array
  }
}
```

### Additional Attributes
`style`
Containing element inline style.

`styleClass`
Containing element style classes.

`delay`
The amount of milliseconds to wait, after typing has stopped, to execute the
`onComplete` callback.

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