Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter does not work together with ngModel #191

Open
bjolletz opened this issue Aug 31, 2018 · 0 comments
Open

Formatter does not work together with ngModel #191

bjolletz opened this issue Aug 31, 2018 · 0 comments

Comments

@bjolletz
Copy link

Hi!

Thanks for providing this component!

I have a problem with using a formatter together with ngModel. As far as I understand, when using a formatter you are supposed to provide 'formatted' values for ngModel. Because if I don't, then the sliders will not begin at the correct positions. However, when changing the sliders, 'unformatted' values are assigned back to the ngModel property.

For instance, if I begin with something like

model = ['#1', '#2']; // Formatted values

[(ngModel)]="model",
[format]="someFormatter"

...and provide a formatter that maps back and forth between numbers and strings, then after dragging the slider, the value of the model property will be an (unformatted) array of numbers instead of the expected array of (formatted) strings.

This might be related to #50 . Is this something you're aware of? I could probably provide an example project, but will not bother if you're already aware of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant