angularjs - How to specify function name on $http.get status? -
i have angular function looks this.
function request($scope, $http) { $http.get("http://www.w3schools.com/angular/customers.php") .success(function (response) { $scope.names = response.records; }); }
i replace anonymous function regular function rid of ugly indentation. not sure doing because have not success. basically, to this.
function request($scope, $http) { processgoodstatus = function (response) { $scope.names = response.records; } $http.get("http://www.w3schools.com/angular/customers.php") .success(processgoodstatus); }
how ? help.
you forget use var
declare
var processgoodstatus = function (response) { $scope.names = response.records; }
Comments
Post a Comment