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