uhlryk / angular-dynamic-number

Highly customizable angular directive for numbers
64 stars 32 forks source link

Make numFixed configurable #23

Open schinken opened 8 years ago

schinken commented 8 years ago

As I wanted to use the feature, I found it not working. The value for isFixed was always false and not configurable at all.

This commit fixes that

uhlryk commented 8 years ago

Thanks again for your work.

The value for isFixed was always false and not configurable at all.

yes, because numFixed was created only for filter, and filter and directive use same methods. You can see that it is used here : https://github.com/uhlryk/angular-dynamic-number/blob/master/src/numberDirective.js#L622

In your code you enabled using fixed value for directive, but I think that to make it work for directive it need much more work. And it wouldn't be easy. Because I think that if we allowfixed value for directive, it have to work like :

  1. user type any value to input field (for example we type 1), then model value should work like before (has value 1), but input field should change it value to 1.00, but put cursor after 1. Then there would be many new cases

Please write your opinion. And if your code should work right now, please write example, how I can reproduce it behavior.