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

Auto casting of Integer to String behavior #2

Closed
ciolben opened this issue Feb 13, 2017 · 2 comments
Closed

Auto casting of Integer to String behavior #2

ciolben opened this issue Feb 13, 2017 · 2 comments

Comments

@ciolben
Copy link

ciolben commented Feb 13, 2017

Hello (and thank you for your awesome work)!

I have a improvement suggestion, let define this scenario:
in controller : model.intList = [1,2,3,4]; model.anotherIntList = [1,2]
in html:
<... data-ylcLoop="int: intList" data-ylcBind="prop.checked: otherIntList.indexOf(int) != -1"
After an event that needs to remodel the html, intList changes to ["1", "2", "3", "4"], hence breaking the condition in the html and it always evaluates to false.

There are some ways to circumvent this problem, but it would be great if the library could just keep the original element's types.
If too difficult, why not supporting parseInt in the html attribute?

Thank you very much!

@pr83
Copy link
Owner

pr83 commented Feb 14, 2017

Hello,
That's a good point, thank you.
I have committed a fix for this problem - the original model type should now be preserved when doing the view-to-model synchronization. Release 0.99.12 includes the fix, please go the official website to download it.

@ciolben
Copy link
Author

ciolben commented Feb 15, 2017

Very fast reply!
Thank you very much for the fix!

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

2 participants