I am new in angularjs. I was trying to post some data to the server through $http post. My code could reach the server, but data is not passed. I am using golang for back-end. What are the mistakes I made here?
completeCampaign.controller('campaignCtrl', ['$scope', '$http', function(scope, http) {
var Msg = "hai";
http.post("/server_url",Msg).then(function(response) {
console.log(response);
});
}]);
go code:
func (c *CarController) TestFunction() {
msg := c.GetString("Msg")
fmt.Println("Message is: ", msg)
}
output:
Message is: