This repository was archived by the owner on Feb 7, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 33 "description" : " Polymer element that fetches GitHub README" ,
44 "main" : " github-readme.html" ,
55 "dependencies" : {
6- "polymer" : " Polymer/polymer#^1.4.0"
6+ "polymer" : " Polymer/polymer#^1.4.0" ,
7+ "iron-ajax" : " ~1.2.0"
78 },
89 "devDependencies" : {
910 "iron-component-page" : " PolymerElements/iron-component-page#^1.0.0" ,
Original file line number Diff line number Diff line change 2020 < h3 > Basic github-readme Demo</ h3 >
2121 < demo-snippet >
2222 < template >
23- < github-readme > </ github-readme >
23+ < github-readme repo =" zenorocha/clipboard.js " > </ github-readme >
2424 </ template >
2525 </ demo-snippet >
2626 </ div >
Original file line number Diff line number Diff line change 11< link rel ="import " href ="../polymer/polymer.html ">
2+ < link rel ="import " href ="../iron-ajax/iron-ajax.html ">
23
34< dom-module id ="github-readme ">
45 < template >
6+ < iron-ajax
7+ auto
8+ url ="https://api.github.com/repos/[[repo]]/readme "
9+ headers ='{"Accept": "application/vnd.github.VERSION.html"} '
10+ handle-as ="text "
11+ on-response ="handleResponse ">
12+ </ iron-ajax >
13+
514 < style >
615 : host {
716 dis play: block;
817 }
918 </ style >
10- < h2 > Hello [[prop1]]</ h2 >
19+
20+ < div id ="readme "> </ div >
1121 </ template >
1222
1323 < script >
@@ -16,12 +26,16 @@ <h2>Hello [[prop1]]</h2>
1626 is : 'github-readme' ,
1727
1828 properties : {
19- prop1 : {
29+ repo : {
2030 type : String ,
21- value : 'github-readme' ,
22- } ,
31+ value : 'customelements/ github-readme' ,
32+ }
2333 } ,
2434
35+ handleResponse : function ( e ) {
36+ this . $ . readme . innerHTML = e . detail . response ;
37+ }
38+
2539 } ) ;
2640 </ script >
2741</ dom-module >
You can’t perform that action at this time.
0 commit comments