I have the following code:
Angular Code:
$http.get('admin/a').success(function(){
console.log("A finish");
});
$http.get('admin/b').success(function(){
console.log("B finish");
});
PHP Code:
Route::group(array('prefix' => 'admin'), function()
{
Route::get('a', array('before' => 'auth.backend', function(){
// SLEEP!
sleep(5);
return Response::json(array('a' => 'a'));
}));
Route::get('b', array('before' => 'auth.backend', function(){
return Response::json(array('b' => 'b'));
}));
}
My problem is that the second http call does not start until the first http call finish, as you see the first route sleeps five seconds.
Does anybody know how fire and start this requests at the same time?
Thanks!