-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29d49e3
commit cc534af
Showing
5 changed files
with
70 additions
and
35 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js'; | ||
import '@polymer/iron-ajax/iron-ajax.js'; | ||
import'./book-description.js'; | ||
import'./table-of-contents.js'; | ||
import'./book-title.js'; | ||
|
||
class BookView extends PolymerElement { | ||
static get template() { | ||
return html` | ||
<style> | ||
:host { | ||
} | ||
.book-data { | ||
width: 100%; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
} | ||
</style> | ||
<iron-ajax | ||
auto | ||
url="https://d1re4mvb3lawey.cloudfront.net/pg1017/index.json" | ||
handle-as="json" | ||
on-response="handleResponse"> | ||
</iron-ajax> | ||
<div class="book-data"> | ||
<book-title title="{{bookData.title}}"> | ||
</book-title> | ||
<book-description isbn="{{bookData.isbn}}" authors="{{bookData.contributors}}"> | ||
</book-description> | ||
<table-of-contents toc="{{bookData.toc}}"> | ||
</table-of-contents> | ||
</div> | ||
`; | ||
} | ||
handleResponse(res){ | ||
this.bookData = res.detail.response | ||
console.log(this.bookData.toc) | ||
return | ||
} | ||
constructor() { | ||
super(); | ||
this.bookData = {} | ||
} | ||
} | ||
|
||
window.customElements.define('book-view', BookView); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters