1
var SaveIdeaEvaluationForm = function (evaluationForm, ideaId, stageId, isEvaluated) {
            return $http({
                url: SparkApp.FormEvaluation.SaveIdeaEvaluationForm,
                method: "POST",
                contentType: "application/x-www-form-urlencoded",
                dataType: "json",
                data: {
                    "evaluationForm": evaluationForm,
                    "ideaId": ideaId,
                    "stageId": stageId,
                    "isEvaluated": isEvaluated
                }
            });
        };

its asynchronous by default , do we have any property to set as synchronous??

1 Answer 1

1

It is widely encouraged to utilise the $http service asynchronously. See this approach:

// Simple GET request example:
$http({
  method: 'GET',
  url: '/someUrl'
}).then(function successCallback(response) {
    // this callback will be called asynchronously
    // when the response is available
  }, function errorCallback(response) {
    // called asynchronously if an error occurs
    // or server returns response with an error status.
  });

https://docs.angularjs.org/api/ng/service/$http

If for some reason, you cannot do this, utilise the $q library as DrenP suggested.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.