Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "books" : {
- "-KfwYdQClUK9ivglf-Jq" : {
- "-KfwYdQClUK9ivglf-Jr" : {
- "author" : "Rand",
- "description" : "something",
- "id" : "-KfwYdQClUK9ivglf-Jq",
- "title" : "sometitle"
- }
- },
- "-Kfly2F4T_ORCra5e01W" : {
- "-Kfly2F4T_ORCra5e01X" : {
- "author" : "Rand",
- "description" : "something",
- "id" : "-KfwYdQClUK9ivglf-Jq",
- "title" : "sometitle"
- }
- }
- }
- var booksController = function () {
- function all(context) {
- templates.get('books')
- .then(function (template) {
- var data = [];
- var booksRef = firebase.database().ref('books');
- booksRef.on('value', function (snapshot) {
- var a = snapshot.val();
- data.push(a);
- context.$element().html(template(data));
- });
- });
- }
- <ul>
- {{#each this}}
- {{#each this}}
- {{#each this}}
- <li>
- <p id="{{id}}">Author: {{author}}</p>
- <p>Title: {{title}}</p>
- </li>
- {{/each}}
- {{/each}}
- {{/each}}
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement