Skip to content

Instantly share code, notes, and snippets.

@katowulf

katowulf/example.html Secret

Last active Aug 29, 2015
Embed
What would you like to do?
<div ng-controller="ctrl">
<h1>{{post.title}}</h1>
<p>{{post.description}}</p>
</div>
app.controller('ctrl', function($scope, Post) {
$scope.post = new Post('post123');
});
app.factory('ref', function(FIREBASE_URL, Firebase) {
return function(path) {
return new Firebase(FIREBASE_URL).child(path);
}
});
app.factory('Post', function(ref, $firebase) {
return function(postId) {
return $firebase(ref('posts/'+postId)).$asObject();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment