Answer the question
In order to leave comments, you need to log in
How to put timeout in AngularJS?
Did you do it right?
function gameData($http) {
$http.defaults.xsrfHeaderName = 'X-CSRFToken';
$http.defaults.xsrfCookieName = 'csrftoken';
$http.defaults.timeout = 6000;
return {
get: function (success, error) {
var options = {
method: 'GET',
url: '/game/api/',
headers: { 'Content-Type': 'application/json; charset=UTF-8' }
};
$http(options).then(success).catch(error);
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question