Znowman Znowman - 8 months ago 88
AngularJS Question

AngularJS API call

Trying to make an API call.

var app = angular.module("testApp", []);
app.controller("mCtrl", ["$scope", "$http", function($scope, $http) {
.success(function(data) {
$scope.data = data;


Keep getting a 404 response. I can access the data when using the address in the browser though.


First, you should be using $http.get('...') instead of $http.jsonp('...')

And second you forgot to add 'http://...' to the route

The correct way is

  .then(function(data) {
    $scope.data = data;

I've tested it, it should work