聚合物1.x + Firebase ==你好世界? [英] Polymer 1.x + Firebase == Hello world?

查看:148
本文介绍了聚合物1.x + Firebase ==你好世界?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Polymer firebase-collection 元素制作 Hello,world 。 b
$ b

我希望看到一个或多个 Hello,world 的重复,并且在控制台中没有错误。相反,我没有看到 Hello,world 和许多以下列开头的控制台错误:

console.log

  ReferenceError:未定义Firebase 

重新创建问题,请按照下列步骤操作:


  1. 打开这个jsBin

  2. ❌观察不到 Hello,world 和控制台中的错误。

请注意,< firebase-collection> 代码仅仅是复制/粘贴来自位于此处的官方文档



http ://jsbin.com/guzimubuma/edit?html,console,输出

 <!doctype html> 
< head>
< meta charset =utf-8>
<!---->
< base href =https://polygit.org/components/>
<!---->
服务器关闭时,切换为低于/高于备份
<!---- ---->
< base href =https://polygit2.appspot.com/components/>
<!---->
< script src =webcomponentsjs / webcomponents-lite.min.js>< / script>
< link href =polymer / polymer.html =import>
< link href =firebase-element / firebase-collection.html =import>
< link href =paper-button / paper-button.html =import>
< / head>
< body>

< dom-module id =x-element>

< template>
< style>< / style>

< p>
< / p>
<!---->
location =https://dinosaur-facts.firebaseio.com/dinosaurs
data ={{dinosaurs}}>< / firebase-收集>
< template is =dom-repeatitems =[[dinosaurs]]as =dinosaur>
您好,世界
< / template>
<!---->
您好,世界

< / template>

< script>
(函数(){
聚合物({
是:x-element,
_handleClick函数(){
console.log('您点击了我!');
}
});
})();
< / script>

< / dom-module>

< x-element>< / x-element>

< / body>


解决方案

这个问题是由服务器问题(在polygit2.appspot.com )现在已经解决了。


I want to make Hello, world with the Polymer firebase-collection element.

I expect to see one or more repetitions of Hello, world and no errors in the console. Instead, I see no Hello, world and many console errors beginning with:

console.log

ReferenceError: Firebase is not defined

To recreate the problem, follow these steps:

  1. Open this jsBin.
  2. ❌ Observe no Hello, world and errors in the console.

Notice the <firebase-collection> code is simply a copy/paste from the official documentation located here.

http://jsbin.com/guzimubuma/edit?html,console,output

<!doctype html>
<head>
  <meta charset="utf-8">
  <!---- >
  <base href="https://polygit.org/components/">
  <!---- >
  Toggle below/above as backup when server is down
  <!---->
  <base href="https://polygit2.appspot.com/components/">
  <!---->
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="firebase-element/firebase-collection.html" rel="import">
  <link href="paper-button/paper-button.html" rel="import">
</head>
<body>

<dom-module id="x-element">

<template>
  <style></style>

  <p>
    <paper-button on-tap="_handleClick">Click Me</paper-button>
  </p>
  <!---->
    <firebase-collection
      location="https://dinosaur-facts.firebaseio.com/dinosaurs"
      data="{{dinosaurs}}"></firebase-collection>
    <template is="dom-repeat" items="[[dinosaurs]]" as="dinosaur">
      Hello, world
    </template>
  <!---->
  Hello, world

</template>

<script>
  (function(){
    Polymer({
      is: "x-element",
      _handleClick: function() {
        console.log('You clicked me!');
      }
    });
  })();
</script>

</dom-module>

<x-element></x-element>

</body>

解决方案

Summary from comments.

This problem was created by a server issue (at polygit2.appspot.com) that is now resolved.

这篇关于聚合物1.x + Firebase ==你好世界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆