I'm using angular-mock to simulate an httpBackend for an Angular app. The response status should depend on the posted data.
I'm not using this for testing, but as a full frontend version of a fullstack (PHP-Angular) application.
Is this even possible ?
$http.post('/play', {move:$scope.move})
.then(
// success
function(result) {
angular.forEach(result.data,
function(index) {
// do something with the data
}
);
},
// error: increment error_counter
function() {
$scope.error_count ++;
}
)
.then(
function() {
// do some extra stuff
}
);
}