Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Polymer index.html中脚本的最佳实践_Polymer - Fatal编程技术网

Polymer index.html中脚本的最佳实践

Polymer index.html中脚本的最佳实践,polymer,Polymer,在polymer中将脚本链接到index.html的最佳实践是什么。我的索引文件中有一个菜单,如果根据用户权限隐藏某些按钮,则使用dom。该权限检查使用ajaxiron ajax。我不确定如何将Polymer{}链接到索引,因为索引不是自定义元素 <template is="dom-bind" id="app"> <template is="dom-if" if="{{myProp}}"> </template> </template>

在polymer中将脚本链接到index.html的最佳实践是什么。我的索引文件中有一个菜单,如果根据用户权限隐藏某些按钮,则使用dom。该权限检查使用ajaxiron ajax。我不确定如何将Polymer{}链接到索引,因为索引不是自定义元素

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

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