Need help with data bindings

18 views
Skip to first unread message

Ankit Singhal

unread,
Jan 4, 2018, 4:54:19 PM1/4/18
to Polymer
Hi,

I am very new to polymer and learning it. need your guidance as I develop the application. I am struggling with data binding with in my components. My requirement is very similar to Linking paths with data bindings.

Parent element -


<template>

<add-bank-account bankInfo="{{checkingBankInfo}}" id="bankAccountDisplay"></add-bank-account>

</div>

</template>


I have a custom element add-bank-account.html which is a child having three property

<template>


<paper-input label="Name" placeholder="" value="{{bankInfo.nameOnAccount}}"></paper-input>


<paper-input label="Rtn" placeholder="" value="{{bankInfo.routingNumber}}></paper-input>


<paper-input label="Acct" placeholder="" value="{{bankInfo.accountNumber}}"></paper-input>


</template>


Changes in add-bank-account are not getting observed in checkingBankInfo object of add-checking-account component.  


I am expecting that as I have done 2 way binding so any changes to property of bankInfo should be observed inside  checkingBankInfo property of Parent component.


thanks for your help.



Karl Tiedt

unread,
Jan 4, 2018, 5:29:37 PM1/4/18
to Ankit Singhal, Polymer
properties are hyphenated because html attributes are case insensitive you need to use bank-info="{{checkingBankInfo}}" as per the documentation here: https://www.polymer-project.org/2.0/docs/devguide/data-binding in "Anatomy of a data binding"

-Karl Tiedt

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/6feee57b-7b67-4f1d-8dc3-93c679ce12a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ankit Singhal

unread,
Jan 4, 2018, 9:22:02 PM1/4/18
to Karl Tiedt, Polymer
That was it, thank you so much. Appreciate your quick response.
Reply all
Reply to author
Forward
0 new messages