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
<body onLoad = "init()"> | |
</body> |
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
{ | |
_id: {string}. The id of the newsfeed. | |
actor: {string}. The name of the actor (the person who performed the action). | |
action: {string}. The action performed (e.g. 'event::created'). | |
object: {Object}. A JSON(P) object representing the object on which the action was performed. |
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
{ | |
actor: {string}. Creator | |
action: {string}. Event | |
object: {Object}. JSONP | |
} | |
**add | |
_id: {Integer}. | |
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
- event::create. Event has been created. The object parameter contains the created event. | |
- event::deleted. Event has been deleted. The object parameter contains the deleted event. | |
- event::new. The actor has written a new post. The object parameter contains the contents of the post. |
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
Get a specific newsfeed item by id. This will return only one newsfeed item where the _id corresponds to the item_id you passed in. **use time/date stamp** |
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
The action parameter is in the format {object_type} : : {operation}. If you have a newsfeed item with action = event : :*, then the object parameter will contain data in the format expected of an event object type. The object types are listed below. When created a new activity, you must make sure the action corresponds with the object type. | |
- event | |
{ | |
title: {string}, | |
description: {String}, | |
start: {Date}, | |
duration: {Integer}, // duration in seconds | |
} |
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
$scope.products = MyProduct.find({ | |
filter: { | |
where: {price: {lt: 100}}, | |
order: 'price ASC', | |
limit: 3 | |
} | |
}); |
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 go() { | |
var userId = prompt('Username?', 'Guest'); | |
checkIfUserExists(userId); | |
} | |
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users'; | |
function userExistsCallback(userId, exists) { | |
if (exists) { | |
alert('user ' + userId + ' exists!'); |
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
/*************************************************** | |
* Assuming you can't use priorities (e.g. they are already being used for something else) | |
* You can store the email addresses in an index and use that to match them to user ids | |
***************************************************/ | |
var fb = new Firebase(URL); | |
/** | |
* Looks up a user id by email address and invokes callback with the id or null if not found | |
* @return {Object|null} the object contains the key/value hash for one user |
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
/* | |
This example shows how you can use your data structure as a basis for | |
your Firebase security rules to implement role-based security. We store | |
each user by their Twitter uid, and use the following simplistic approach | |
for user roles: | |
0 - GUEST | |
10 - USER | |
20 - MODERATOR |