firebase/angularFire — pull request #91 by ItsLeeOwen (2013-08-15 05:47:27+00:00)
Title: angularFireResource + firebase directive

Demo: http://jsfiddle.net/ItsLeeOwen/Xapq4/

Reason For Additions:
- Declarative directive syntax to interface w/ firebase.
- A service where $scope is optional
- Explicit controls where the scope target-reference could be either a collection or an object.

Added:
- "angularFireResource" service.
- "firebase" directive built on angularFireResource service.

Directive: Super simple declarative syntax for getting firebase data into your angularJS apps.

Example:

Service: Support for a variety of ways of integrating firebase data into your client app, including explicit control that is compatible with either a collection or object snapshot value.

Example 1:
angularFireResource(
'https://lee.firebaseio.com/gizmos',
$scope,
'gizmos'
);

Example 2:
angularFireResource(
'https://lee.firebaseio.com/gizmos',
$scope,
[]
);

Example 3:
var resource = angularFireResource(
'https://YOURFIREBASE.firebaseio.com/stuff'
);
resource.promise.then(function(stuff) {
$scope.stuff = stuff;
$scope.$watch('stuff', function(value) {
resource.set(value);
}, true);
});

Example 4:
$scope.data = {}
angularFireResource(
'https://lee.firebaseio.com/gizmos',
null,
$scope.data
);