TestApp.controller('MainCtrl', ['$scope','$http', function ($scope,$http) { $http.post('test.php') .success(function(data){ console.log(data) }) .error(function(data,status){ console.log('error'); }) }]) test.php
<?php echo false; TestApp.controller('MainCtrl', ['$scope','$http', function ($scope,$http) { $http.post('test.php') .success(function(data){ console.log(data) }) .error(function(data,status){ console.log('error'); }) }]) test.php
<?php echo false; You most likely mean that always success, go to the Chrome debugger there will be a server response in the network, since the request was successful then data.result == SUCCESS for this and true.
Source: https://ru.stackoverflow.com/questions/513553/
All Articles