Hi, i get this error on run a function with $http.get: "angular.js:12477 
TypeError: $http.get(...).succes is not a function" when $http works in a 
controller


I need a button to call rest service, i using with ng-click directive but 
on call the function, show the error.

Code in a controller:
https://jsfiddle.net/z577vsbe/
var app = angular.module("StorePrincipal", [])
app.controller("listAll", function ($scope, $http){
$http.get("../api/get-products")
.success(function(data, status, headers, config){
var arrayProducts = [];
$scope.arrayProducts = []
for(var i = 0; i < data.length; i++){
$scope.arrayProducts.push(data[i].attribs[0])
$scope.arrayProducts[i].urlImg1 = "../img/products/" + 
data[i].attribs[0].img1
$scope.arrayProducts[i].id = data[i]._id
console.log("ID: " + $scope.arrayProducts[i].id);
}
console.log($scope.arrayProducts)
})
.error(function(data, status, headers, config){
alert(status);
})

$scope.removeProduct = function (productID){
console.log(productID);
$http.get("../api/remove-product/" + productID)
.succes(function(data){
console.log("Product Deleted")
})
.error(function(data, status, headers, config){
alert(status);
})
}
});

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to