问题
I am trying to use the MaskedInput widget (https://github.com/bthurlow/nativescript-maskedinput) and I am having trouble getting the databinding to work. Here is my code:
<mi:MaskedInput mask="999 999 9999" placeholder="_" text="{{ customer.homephone }}" color="#a8b4b9" />
The above snippet does not display the phone number initially. I am positive the customer.homephone has value in it because
<TextField text="{{ customer.homephone, customer.homephone | phoneConverter() }}" class="value bold" />
displays it correctly. If I replace the text property of the MaskedInput with a hard-coded value, the value is displayed. It seems to me that there is something going on with the databinding. Am I missing something here?
Any ideas are highly appreciated.
Thank you.
回答1:
You are doing things correctly, but from what I see from the code of that plugin it does not support data binding.
来源:https://stackoverflow.com/questions/38017201/nativescript-maskedinput-databinding