ng-pinyin

WebJar for ng-pinyin

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

ng-pinyin
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

ng-pinyin
WebJar for ng-pinyin
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/iensu/ng-pinyin

Download ng-pinyin

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/ng-pinyin/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>ng-pinyin</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/ng-pinyin/
implementation 'org.webjars.bower:ng-pinyin:0.3.0'
// https://jarcasting.com/artifacts/org.webjars.bower/ng-pinyin/
implementation ("org.webjars.bower:ng-pinyin:0.3.0")
'org.webjars.bower:ng-pinyin:jar:0.3.0'
<dependency org="org.webjars.bower" name="ng-pinyin" rev="0.3.0">
  <artifact name="ng-pinyin" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='ng-pinyin', version='0.3.0')
)
libraryDependencies += "org.webjars.bower" % "ng-pinyin" % "0.3.0"
[org.webjars.bower/ng-pinyin "0.3.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : angular jar [1.2.22,1.3)

Project Modules

There are no modules declared in this project.

ng-pinyin

Angular attribute directive and filter for dynamic rendering of Chinese pinyin tone diacritics.

Each tone is represented by a digit between 1-4, after the syllable to which the tone applies:

  • ni3hao3 -> nǐhǎo
  • pin1yin1 -> pīnyīn
  • zhong1guo2 -> zhōngguó
  • lv4se4 -> lǜsè

Installation

ng-pinyin is available via bower and npm:

bower install ng-pinyin --save
npm install ng-pinyin --save

Usage

ng-pinyin can be used as either an attribute directive or as a filter.

ng-pinyin directive

As an attribute directive it can be applied to any user input field which has a ng-model assigned to it. The ng-model must of course refer to a string. The value will be updated as you type, with the designated pinyin tone markings.

<input ng-pinyin ng-model="text" />
<textarea ng-pinyin ng-model="text" />

pinyin filter

<div>{{someStringVar | pinyin}}</div>

License

MIT

Versions

Version
0.3.0