Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 :-)