[英]Polymer: on-tap not working inside template tag
I am very new to polymer and data-binding. 我对聚合和数据绑定非常陌生。 I am facing this issue and couldn't find something substantial to help me.
我正在面对这个问题,找不到实质性的帮助。 Following is my code snippet:
以下是我的代码段:
<sortable-table>
<sortable-column cellTemplate="callTemplate">Call</sortable-column>
<template id="callTemplate">
<td class="customClass">
<core-icon-button icon="create" on-tap="{{functionCall}}"></core-icon-button>
</td>
</template>
</sortable-table>
<script>
Polymer('element-name', {
functionCall: function() {
alert("hi");
}
});
</script>
But I am unable to run it. 但是我无法运行它。 Please advice what I am doing wrong here.
请在这里告诉我我在做什么错。
I think you are missing a " } " 我认为您缺少“”
Polymer('element-name', {
functionCall: function() {
alert("hi");
}
});
Sortable table is a complicated web-component, provided by Steven Skelton . 可排序表是一个复杂的Web组件, 由Steven Skelton提供 。 There is no way one could play with it without strong understanding of fundamental webcomponents and polymer's polyfill concepts.
如果没有对基本的Web组件和聚合物的Polyfill概念的深入了解,就无法使用它。
I would recommend you to start with reading docs at Polymer project website . 我建议您先从Polymer项目网站上阅读文档。
To use sortable-table
you'll need to create polymer project, bower install sortable-table
, import polyfills etc. It won't run from local static html
page. 要使用
sortable-table
您需要创建聚合物项目, bower install sortable-table
,导入polyfills等。它不会从本地静态html
页面运行。
Further reading would be the home page of component at github (linked in the beginning of this comment.) 进一步的阅读将是github上组件的主页(在此评论的开头链接)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.