confused about the polymer published attributes

送分小仙女□ 提交于 2019-12-02 09:45:52

I know you said you figured it out, but for others coming to this page looking for a fully-working solution and explanation, here it is.

If you want data binding without having to create a custom element, you must put your code into a template with the is attribute set to auto-binding:

<template is="auto-binding">
  <core-ajax url="./ajax-test.txt" auto response="{{resp}}"></core-ajax>
  <textarea value="{{resp}}"></textarea>
</template>

Without this, Polymer won't know it needs to hook up the bindings in your html, and things like {{resp}} will be treated as text.

More detailed explanation can be found here: http://www.polymer-project.org/docs/polymer/databinding-advanced.html#autobinding

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!