AngularJS: Should I use a filter to convert integer values into percentages?

后端 未结 2 1991
谎友^
谎友^ 2021-02-20 02:20

I need to collect a rate of change - in percentages - from my application\'s users. Here is the text input I am using:

2条回答
  •  天命终不由人
    2021-02-20 03:09

    I think you should use a directive. If you think you are about to fall back to using JQuery to start manipulating the DOM elements then a directive is probably what you want.

    This is an example of a filter: http://embed.plnkr.co/TT6ZwOF6nYXwMcemR3JF/preview

    What you could do is filter the value you enter as part of a watch event. However that depends on your specific use case.

提交回复
热议问题