Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Building with AngularJS and APIs

joseph mallari
joseph mallari
4,052 Points

Could have they updated the API today? This link isn't available anymore. dribbble.com/api#get_shots_list .

Also, my callback worked earlier but now it doesn't.

var controllers = angular.module('dabbble.controllers', []);

controllers.controller('AppCtrl', function($scope) { $scope.name = "Module"; });

controllers.controller('ShotsListCtrl', function($scope, $http) {

    $http.jsonp('http://api.dribbble.com/shots/popular?callback=JSON_CALLBACK').then(function(data){
        $scope.list = data.data;
        console.log(data);
});

});

<!DOCTYPE html> <html lang="en" ng-app="dabbble"> <head> <meta charset="utf-8"> <title>Dabbble</title> <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css"/> <link rel="stylesheet" href="css/app.css"/> </head> <body ng-controller="AppCtrl"> <div class="container"> <div class="navbar"> <div class="navbar-inner"> <a class="brand" href="#">Dabbble</a> <ul class="nav"> </ul> </div> </div> <div ng-controller="ShotsListCtrl"> <ul class="thubnails"> <li class="thumbnail" ng-repeat="shot in list.shots"> {{ shot.title }} <img ng-src="{{shot.image_url}}"> </li> </ul> </div> </div> <script src="lib/angular/angular.js"></script> <script src="js/app.js"></script> <script src="js/services.js"></script> <script src="js/controllers.js"></script> <script src="js/filters.js"></script> <script src="js/directives.js"></script> </body> </html>

1 Answer

Looks like they changed the API to require an OAuth security token. I guess this tutorial is now outdated.

http://developer.dribbble.com/v1/oauth/