Actually, I think the problem is the reverse. You should see a log message
that says:

Attributes on child-test were data bound prior to Polymer upgrading the
element. This may result in incorrect binding types.

If you flip the order of definitions, child-test is defined before you try
to define parent-test, and the data binding gets initialized correctly.


On Fri, Jan 30, 2015 at 6:19 AM, <[email protected]> wrote:

> I am calling a polymer element within another element. The inner polymer
> element has a published attribute to which I am binding JSON from the
> parent polymer. However it is not getting reflected.
>
> <polymer-element name="parent-test" attributes="testData">
>     <template>
>
>         This is Parent test
>         <child-test testdatachild="{{testData}}"></child-test>
>
>     </template>
>     <script>
>         Polymer('parent-test', {
>             testData: [],
>             ready: function () {
>                 debugger;
>                 this.testData = [1, 2, 3, 4]
>             }
>         });
>     </script></polymer-element>
>
> <polymer-element name="child-test" attributes="testDataChild">
>     <template>
>         <!--{{testDataChild}}-->
>         <template repeat="{{test in testDataChild}}">
>             {{test}}
>         </template>
>
>
>     </template>
>     <script>
>         Polymer('child-test', {
>             testDataChild: [],
>             ready: function () {
>                 debugger;
>             }
>         });
>     </script></polymer-element>
>
> I am not sure what could be the problem here.
>
> Seems like I am not having the actual parentContent at the time of
> generating the child-polymer-element. If I assign hardcoded values in ready
> function for this.parentContent, it doesnt work as well. If I assign
> hardcoded values in create function for this parent.Content, it works. So,
> I am not not sure if this is something related to generating the child
> polymer element before the values getting binded to parent.
>
> Also, it works if testDataChild is a string and not an array
>
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/19c92ca5-d86f-48a3-9bf0-337173a64d1e%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/19c92ca5-d86f-48a3-9bf0-337173a64d1e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CADSbU_zWKS-B26_CdgwTF%2BCsSWD3V5PkPHOo9Zzc%2Bu8vAB-TAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to