Git Product home page Git Product logo

ng-pinyin's Introduction

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

ng-pinyin's People

Contributors

iensu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ng-pinyin's Issues

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.