On your element prototype set post: {}

You need to hint to polymer that it should treat that property as an object
instead of a string
On Jul 25, 2014 1:32 PM, "babak slt" <[email protected]> wrote:

> I have no idea why is this happening! i want to send an object to polymer
> element and then use it. im using something like this for the element
>
> <polymer-element name="post-thumb" attributes="post">
>   <template>
>     <article>
>       <span>this is a post thumb</span>
>         <h1>{{post.title}}</h1>
>         <p>{{post.body}}</p>
>     </article>
>   </template>
>   <script>
>   Polymer('post-thumb');
>   </script></polymer-element>
>
> and after HTML import, i'm calling it like this:
>
> <post-thumb post='{"title":"post title 1","body":"post body"}'> </post-thumb>
>
> it's weird cause when i use {{post}} it'll bring back the whole
> {"title":"post title 1","body":"post body"} but when i use {{post.title}}
> polymer simply returns nothing!
>
> what's wrong here!? :/
>
>
>
> http://stackoverflow.com/questions/24963929/sending-json-obj-to-polymer-element
>
> 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/b8f4a9c2-c68a-4957-922f-0673d687e228%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/b8f4a9c2-c68a-4957-922f-0673d687e228%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/CAJj5OwDiOdyATgP-BDqZLTU2s7Gp170k1KN8noxq1Hcm64Q_xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to