else if ($scope.selectedItem == 1) {
$scope.newScoreTableValue.questionnaireQuestionID = $scope.questionTempId;
$scope.newScoreTableValue.responseType = $scope.selectedItem;
$scope.newScoreTableValue.responseShortForm = "Yes";
$scope.newScoreTableValue.responseValue = $scope.valueyes;
$scope.loading = true;
$http.post('/api/QuestionResponse/', $scope.newScoreTableValue).success(function (data) {// POST api/<controller>
public QuestionnaireQuestionResponses Post(QuestionnaireQuestionResponses response)
{
return _QuestionRepository.SaveQuestionResponse(response);
}
My disconnect is that I can't figure out where the response object is coming from. When I step through the code I go from the $http.post to the Post(...) method. There is a value in the response object I need to set. Is there some intermediate step that I'm missing?
I'm hope this is enough to go on. I'm hoping someone will see this and say, "Oh, you need to look for ..."
Thanks,
Carlo.
Hi Carlo,
I need to assume a lot here, so I might be off.
Under the assumption that your server routes the /api/QuestionResponse/
to your public QuestionnaireQuestionResponses Post(QuestionnaireQuestionResponses response)
, The data flow does indeed go from the $http
call via your servers router to your server function. If you look up the documentation of $http
you will likely get an answer to your question.
It boils down to this, If you want to add content, you need to put it in $scope.newScoreTableValue
, if you want to add anything else (usually headers) you need to add it to the config of your $http
call.
Does that help a bit?
Regards
Sander
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/eup7x7WQhwg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Hi Carlo,
Usually a response object is an object that contains the payload, with the payload being the newScoreTableValue
.
Regards
Sander