Polymer attributes and variable mapping

时间:2015-06-25 19:14:25

标签: html polymer

I have a polymer element looking like this: <polymer-element name="foo" attributes="bar"> <template> <core-ajax url="url.php" params="{{ {last: bar} }}"></core-ajax> {{bar}} </template> </polymer-element> Though, when I create element, the attribute shows up on the page, but the ajax request is like url.php?last so it seems that variable is undefined. Also, this.bar returns undefined. How can I solve that?

1 个答案:

答案 0 :(得分:0)

请记住,核心-ajax在聚合物1.0中被弃用为铁-ajax。

无论如何,是否正确解决了params绑定?

基于documentation for new iron-ajax element,sintax应该是:

  

params =&#39; {&#34; alt&#34;:&#34; json&#34;,&#34; q&#34;:&#34; chrome&#34;}&#39;