This is my code:
$(function () {
$http.get('../PostJson/' + $scope.postid).success(function (data) {
$scope.curpost = data;
$scope.cursol = data[0].IsSolved;
$scope.soltxt = ""
if ($scope.cursol == 1) {
$scope.paneltheme = "panel-primary";
$scope.soltxt = "Solved";
}
else {
$scope.paneltheme = "panel-forums";
}
});
$http.get('../ReplyJson/' + $scope.postid).success(function (data) {
$scope.currep = data;
});
$scope.submitReply = function () {
var reply = { UserID: $scope.RepUserID, PostID:
$scope.RepPostID, Body: $scope.RepBody };
$http.post('../CreateReply', reply).success(function () {
$http.get('../ReplyJson/' + $scope.postid).success(function
(data) {
$scope.currep = data;
});
})
}
$scope.submitAns = function () {
$http.post('../Solved?id=' + $scope.postid + '&user=' +
$scope.RepUserID).success(function () {
});
}
});
What i just want to do is to update $scope.cursol once $scope.submitAns()
is triggered.
Thanks
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.