だから私はangularjsで送信しようとしてGet request
います
しかし、私はこのエラーが発生しています
Error: Argument 'SimpleController' is not a function, got undefined
ここに私のコードがあります
var module = angular.module('myApp', []);
module.config(function ($httpProvider) {
$httpProvider.defaults.headers.post['SOAPAction'] = 'http://schemas.microsoft.com/sharepoint/soap/UpdateListItems';
});
function SimpleController($scope,$http)
{
$http({
url: "http://localhost:8080/petstore/pets/list",
method: "GET",
})
.success(function(data){
console.log("SUCCESS");
$scope.pets = data;
}).error(function() {
console.log("FAIL");
console.log("data: "+data+"\nstatus: "+status+"\nheaders: "+headers+"\nconfig: "+config)
$scope.pets = [ {"id":1,"name":"Angelfish","description":"Saltwater fish from Australia","category":"Fish","imageUrl":"fish1.jpg","price":10}];
});
}