I'm starting to learn Angular and I want to play around with the $http call function. I basically want to make a get request to an external API:
angular.module('pokedexApp')
.controller('MainCtrl', function ($scope, $http) {
var response;
$http.jsonp("http://pokeapi.co/api/v1/pokemon/1/").success(function(response) {
response = response;
})
$scope.pokemon = response;
});
I'm probably completely wrong as to how this works. I basically want to {{ pokemon }} out a response to test it.
I'm getting a Uncaught SyntaxError: Unexpected token : error and I can't tell if it's because the return data isn't properly formatted or what.