Polymer Starter Kit adding function equivalent to ready for the main page
我有一个新创建的聚合物入门套件,确切地说是 1.3。
我想在 index.html 页面上创建一个类似下面的方法
1 2 3 4 5 6 7 8 9 | ready: function() { firebase.auth().onAuthStateChanged(function(user) { if(user) { // console.log('user is logged in'); } else { // console.log('user is not logged in'); } }); } |
在主页上,我该怎么做?我想为应用程序模板实例化一个 Polymer 元素,但应该避免文档保留。如果有人能解释为什么那会很棒。
提前感谢您的任何反馈!
On the main page, how can I do it?
在
1 2 3 4 | window.addEventListener('WebComponentsReady', function(e) { // imports are loaded and elements have been registered ... }); |
I would like to instantiate a Polymer element for the application template, but the document stays that should be avoided.
你在哪里看到的?虽然 Polymer Starter Kit 1.3.0 版在
-
Polymer Starter Kit 第 2 版将自动绑定模板替换为自定义应用元素
-
开发指南将基本应用程序模板(由
polymer-cli 生成)描述为自定义元素:The
application template is the most basic starting point for any app built with Polymer. It starts with a single bare-bones custom element that can serve as the root of your application, from which you can build in any direction with maximum flexibility.