LoginSignup
2
2

More than 5 years have passed since last update.

[Angular] Pipe を Typescript コード中で使う

Last updated at Posted at 2018-05-20

Angularにおいて、 Pipe は、 html 内で利用して、各種表示用の変換を行ってくれます。
しかし、たまに html の外で使いたい(Typescriptのコード内で使いたい)ということがあります。

そういう場合は、特に何も考えず、インスタンス化してメソッドを使うと良いです。

↓例

new PhoneNumberPip().transform(value)

簡単ですね。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2