Skip to content

Instantly share code, notes, and snippets.

@chalkers
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chalkers/17d290f3fab2d1fe651b to your computer and use it in GitHub Desktop.
Save chalkers/17d290f3fab2d1fe651b to your computer and use it in GitHub Desktop.
angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope, $http) {
//Get profile information
$http.get('https://teamtreehouse.com/chalkers.json').
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
$scope.badges = data.badges;
}).
error(function(data, status, headers, config) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment