Angular 2 Input Custom Pipe

前端 未结 2 807
無奈伤痛
無奈伤痛 2021-01-20 21:31

Is there any way to use currency or a custom pipe inside an input text in Angular 2?

I\'ve tried this:



        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-20 22:07

    It's not possible to use pipes in inputs, even in angular 1.

    What you are looking for is a mask directive. For angular1 there are a lot of directives like ngMask, angular-input-masks and others.

    Angular2 is in release candidate right now (06/02/2016), so there are just a few "directives".

    You can also build your own mask component.

提交回复
热议问题