Use polymer expression on main html site

ぐ巨炮叔叔 提交于 2019-12-24 12:33:40

问题


short question: Is it possible to use polymer expressions on a normal html site? So that I could write {{ 1+ 1 }} somewhere and it would be evaluated to 2.


回答1:


If you mean "without including anything of polymer", than the short answer would be "no". Otherwise here is an example for using a polymer expression outside of a polymer element:

<!doctype html>
<html>

<head>
  <script src="/components/platform/platform.js"></script>
  <link href="/components/polymer/polymer.html" rel="import">    
</head>

<body unresolved>

  <template is="auto-binding">
    1 + 1 is {{1+1}}
  </template>

</body>

</html>


来源:https://stackoverflow.com/questions/24824576/use-polymer-expression-on-main-html-site

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