Skip to content

Instantly share code, notes, and snippets.

@calebcauthon
Created March 10, 2013 18:16
Show Gist options
  • Save calebcauthon/5129738 to your computer and use it in GitHub Desktop.
Save calebcauthon/5129738 to your computer and use it in GitHub Desktop.
How do you get angular to work with async requests?
%h2 Registrations
.row{:"ng-controller" => "RegistrationsCtrl"}
.span6
%ul.players
%li{:"ng-repeat" => "person in registrations"}
{{person.name}}
.span6
.player-info
%script{:type => "text/javascript"}
:plain
function RegistrationsCtrl($scope) {
var registration_list = new Firebase('https://lusl-dev.firebaseIO.com/summer_league_2013/registrations');
registration_list.on('child_added', function(child) {
var reg = child.val();
$scope.registrations.push(reg);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment