-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
51 lines (39 loc) · 1.61 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!doctype html>
<html>
<head>
<meta
name="viewport"
content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/core-ajax/core-ajax.html">
<link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
<link rel="import" href="bower_components/firebase-element/firebase-element.html">
<link rel="import" href="bower_components/paper-item/paper-item.html">
<link rel="stylesheet" href="hacker-news.css">
</head>
<body unresolved>
<template id="page" is=auto-binding>
<firebase-element location="https://hacker-news.firebaseio.com/v0/topstories" data="{{items}}"></firebase-element>
<core-toolbar>
<div id="page-title" flex>Polymer <hacker-news></div>
</core-toolbar>
<ul>
<template repeat="{{item, i in items}}">
<li>
<core-ajax
auto
url="https://hacker-news.firebaseio.com/v0/item/{{item}}.json"
handleAs="json"
response="{{stories[i]}}"></core-ajax>
<a href="{{stories[i].url}}">{{stories[i].title}}</a>
</li>
</template>
</ul>
</template>
<script>
var t = document.querySelector('#page');
t.stories = [];
</script>
</body>
</html>