I am creating an element, which takes one parameter: userid. Inside the component's template I have a core-ajax tag which needs to pass that attribute as a parameter.
I am doing it like this:
<template attributes="userid">
<core-ajax
auto
url="../../ajax/gettoday.php"
handleAs="json"
method="post"
params='{"userid": "{{userid}}"}'
response="{{today}}"></core-ajax>
...
</template>
Is it supposed to accept the attribute inside the params string?
The attributes="userid" needs to be on the <polymer-element>, not the element's <template>. Nothing should go on the topmost <template>.
<polymer-element name="my-element" attributes="userid">
This works for me: http://jsbin.com/fihuyuga/1/edit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With