You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
I am working on the application, where I have input field with ng-model, inside which I need to show number in different units ata time (like px or %),
From the application point of view it is convenient to keep single unit in the model for calculations (i.e model contains only px values), and show different units in input field with help of parsers and formatters. I also have a toggle button for changing the unit.
The problem is , when I try to change the unit, I need formatters to run and store different viewValue inside input field (like instead of px value, show % value in input, though model still has px value).
I did not find any good way of doing this.
I end up incrementing my px value, and in $timeout decrement again, which runs second digest, and causes unwanted UI behaviour (like if model value is binded to something else, it will increment and decrement in few milliseconds, but you can still notice it).
Can we have an api which will trigger formatters for ngModelController and update view value?
The text was updated successfully, but these errors were encountered:
Hello,
I am working on the application, where I have input field with ng-model, inside which I need to show number in different units ata time (like px or %),
From the application point of view it is convenient to keep single unit in the model for calculations (i.e model contains only px values), and show different units in input field with help of parsers and formatters. I also have a toggle button for changing the unit.
The problem is , when I try to change the unit, I need formatters to run and store different viewValue inside input field (like instead of px value, show % value in input, though model still has px value).
I did not find any good way of doing this.
I end up incrementing my px value, and in $timeout decrement again, which runs second digest, and causes unwanted UI behaviour (like if model value is binded to something else, it will increment and decrement in few milliseconds, but you can still notice it).
Can we have an api which will trigger formatters for ngModelController and update view value?
The text was updated successfully, but these errors were encountered: