-
-
Save katowulf/cba7e5215e5d30e1a185 to your computer and use it in GitHub Desktop.
This file contains 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
app.controller('ctrl', function(posts, $scope) { | |
var postId = 'post123'; | |
posts.$loaded(function() { | |
$scope.post = posts.$getRecord(postId); | |
}); | |
}); |
This file contains 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
app.factory('Posts', function(FIREBASE_URL, Firebase, $firebase) { | |
var ref = new Firebase(FIREBASE_URL + 'posts'); | |
return $firebase(ref).$asArray(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment