I am trying to call my Mvc Controller Action from Angularjs controller $http.get(). Please provide some solution.
Controller Action :
[HttpGet]
public string CallMe(int number,string name)
{
return "Welcome " + name +" to Angular Js " + number + " times.";
}
Angular JS Controller
app.controller("StoreController", ["$http", function ($http) {
$http.get("/Home/CallMe", { number: 4, name: "angular" }).success(function (data) {
console.log(data);
}).error(function (error) {
console.log(error);
});
}]);
Also, Could anyone please specify related material for learning?
Thanks in advance.