# ng-pinyin-engine

> pinyin-engine angular version

Latest version **1.1.6** (published 2018-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-pinyin-engine
pnpm add ng-pinyin-engine
yarn add ng-pinyin-engine
bun add ng-pinyin-engine
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2018-06-01 |
| First published | 2018-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 122.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | taozhi |
| Maintainers | taozhi |

## Links

- npm: https://www.npmjs.com/package/ng-pinyin-engine
- Homepage: https://github.com/taozhiw/ng-pinyin-engine
- Issues: https://github.com/taozhiw/ng-pinyin-engine/issues
- npm.io page: https://npm.io/package/ng-pinyin-engine

## Dependencies (2)

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

## Recent versions

- 1.1.6 (latest) — 2018-06-01
- 1.1.5 — 2018-05-31
- 1.1.4 — 2018-05-30
- 1.1.3 — 2018-05-30
- 1.1.2 — 2018-05-30
- 1.1.1 — 2018-05-29
- 1.1.0 — 2018-05-29
- 1.0.0 — 2018-05-28

## README

[![npm version](https://badge.fury.io/js/ng-pinyin-engine.svg)](https://badge.fury.io/js/ng-pinyin-engine)
[![CircleCI](https://circleci.com/gh/taozhiw/ng-pinyin-engine/tree/master.svg?style=svg)](https://circleci.com/gh/taozhiw/ng-pinyin-engine/tree/master)

## ng-pinyin-engine

[pinyin-engine](https://github.com/aui/pinyin-engine) Angular 封装。

## 安装


使用 `yarn` 或者 `npm`
```
yarn add ng-pinyin-engine

npm install ng-pinyin-engine
```


## 使用

### 导入

可直接导入 `NgPinyinEngineModule` 模块，导入后可使用简体与繁体管道。

```typescript
import { NgPinyinEngineModule } from 'ng-pinyin-engine';

@NgModule({
  ...
  imports: [
    NgPinyinEngineModule
  ]
  ...
})
```

或者导入具体的模块，根据需要导入简体或者繁体模块。

```typescript
// 简体搜索模块
import { PinyinCnModule } from 'ng-pinyin-engine';

// 繁体搜索模块
// import { PinyinTwModule } from 'ng-pinyin-engine';

@NgModule({
  ...
  imports: [
    PinyinCnModule,
    // PinyinTwModule
  ]
  ...
})
``` 

### 调用

如果待搜索列表为简单的字符串数组，则只需要传入 `keyword` 查询参数即可。

```html
<li *ngFor="let item of list | pinyinCn:keyword;">{{item}}</li>
```

如果待搜索列表为对象数据组，则除了需要传入 `keyword` 查询参数，还需要传入索引 Key 的配置数组，关于索引 Key 的说明可查看 [pinyin-engine](https://github.com/aui/pinyin-engine) 的文档。

```html
<li *ngFor="let item of list | pinyinCn:keyword:['name'];">{{item.name}}</li>
```


## license

MIT

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