[Angular] Pipe を Typescript コード中で使う
Angularにおいて、 Pipe は、 html
内で利用して、各種表示用の変換を行ってくれます。
しかし、たまに html
の外で使いたい(Typescriptのコード内で使いたい)ということがあります。
そういう場合は、特に何も考えず、インスタンス化してメソッドを使うと良いです。
↓例
new PhoneNumberPip().transform(value)
簡単ですね。
Author And Source
この問題について([Angular] Pipe を Typescript コード中で使う), 我々は、より多くの情報をここで見つけました https://qiita.com/seteen/items/2a5a6cc9730b3b8364c5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .