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

George Drakakis
George Drakakis
6,369 Points

AngularJs Workshop Error

Hi there,

I am trying to make the workshop with dabbble and in 19:34 that you puth the 'callback=JSON_CALLBACK'

I get this this at the top of my html page

and of course it doesn't work and I don't get anything from console.log(data).

// Controller
var controllers = angular.module('dabbble.controllers',[]);
controllers.controller('AppCtrl',function($scope){
    $scope.name = "Module";
});

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

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

Any idea what is wrong?

p.s. Sorry for the formating but really this tab coding block is not user friendly :-)

James Barnett
James Barnett
39,199 Points

Sorry for the formating but really this tab coding block is not user friendly :-)

I fixed your code formatting using code fences.

You can learn about using code fences, in the how to type code in the forum thread.

George Drakakis
George Drakakis
6,369 Points

Thank you James! Lets hope I get an answer on my problem now :-)

1 Answer

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Are you running it off a web server locally?

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

I see the problem. There's a spelling error in dribbble.com. There are 3 b's and you have only 2.

George Drakakis
George Drakakis
6,369 Points

Thank you Amit most probably thats the problem. I'll try that :-)