@clemox/ngx-furigana
v18.0.0
Published
Furigana display service
Downloads
7
Maintainers
Readme
ngx-furigana
This projet is an inspiration of helephant Gem.
The library is full compatible with Angular, and it's simple to use.
Source code
Source code can be found on my GitHub.
Browsers
Compatible with all browsers.
Install
npm install @clemox/ngx-furigana
Usage
- Declare service
import { NgxFuriganaService } from '@clemox/ngx-furigana';
constructor(
private furigana: NgxFuriganaService
) { }
- Call the service
The method "getReading" returns the input text.
// return 食[た]べ物[もの]が好きです
this.furigana.getReading('食[た]べ物[もの]が好きです');
The method "getExpression" returns the text without [...] hiragana.
// return 食べ物が好きです
this.furigana.getExpression('食[た]べ物[もの]が好きです');
The method "getHiragana" returns only the hiragana.
// return たべものが好きです
this.furigana.getExpression('食[た]べ物[もの]が好きです');
The method "getReadingHtml" returns only the RUBY HTML.
// return <ruby><rb>食</rb><rt>た</rt></ruby>べ<ruby><rb>物</rb><rt>もの</rt></ruby>が好きです
this.furigana.getReadingHtml('食[た]べ物[もの]が好きです');