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
Looks like this library isn't getting much updates, but I think it would be cool to have two way filters.
I.e. a phone filter would take a 10 digit value like "1234567890" and convert it to "(123) 456-7890" as the value is being sent to the view. And then strips the formatting upon return the view-model.
I could see enabling this by adding an object the ko.filters object:
I didn't actually test it, so let me know if you run into any problems. This actually isn't best practice in terms of performance because the computed will be re-created each time the value changes, but I'm not sure if there's another way to do it.
Looks like this library isn't getting much updates, but I think it would be cool to have two way filters.
I.e. a phone filter would take a 10 digit value like "1234567890" and convert it to "(123) 456-7890" as the value is being sent to the view. And then strips the formatting upon return the view-model.
I could see enabling this by adding an object the ko.filters object:
Could this somehow be wrapped in an computed prior to binding?
Update: copy and paste fixed.
Update again:
And this would, obviously, be used like this:
The text was updated successfully, but these errors were encountered: