index.html

时间:2015-10-01 10:53:43

标签: polymer

将脚本链接到聚合物中的index.html的最佳做法是什么?我的索引文件中有一个菜单,以及根据用户权限使用dom-if隐藏某些按钮的内容。该权限检查使用ajax(iron-ajax)。我不确定如何将Polymer({})链接到索引,因为索引不是自定义元素。

1 个答案:

答案 0 :(得分:0)

<template is="dom-bind" id="app">
  <template is="dom-if" if="{{myProp}}">
  </template>
</template>

<script>
  var app = document.querySelector('#app');
  app.myProp = true;
</script>