Last active
April 8, 2016 03:23
-
-
Save greggnakamura/781ddd28371390941c3d31531e1fe823 to your computer and use it in GitHub Desktop.
Firebase: `on`
This file contains hidden or 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
(function () { | |
var firebaseRoot = 'https://bookmark-app.firebaseio.com/', | |
bookmarkRef = new Firebase(firebaseRoot + 'bookmarks'); | |
bookmarkRef.on('value', function (snapshot) { | |
var snapshotResult = snapshot.val(); | |
keys = Object.keys(snapshotResult); | |
$.each(keys, function (index) { | |
var $listItem = $('<option>', { | |
value: snapshotResult[keys[index]].tag | |
}); | |
$listItem.append(snapshotResult[keys[index]].tag); | |
$('#output').append($listItem); | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment