Angularjs http get from ASP.NET
<p>I want to get List of employees, after clicking on button <code>Get Data</code>. But JS script does not invoke <code>public JsonResult GetData</code>.</p>

<ol>
<li><p>Why js do not invoke <code>public JsonResult GetData</code> where is mistake?</p></li>
<li><p>How to pass argument in 'public JsonResult GetData(int id)'?</p></li>
</ol>

<p>HomeController:</p>

<pre><code>namespace AngularJS.Controllers
{
public class HomeController : Controller
{
    //
    // GET: /Home/

    public ActionResult Index()
    {
        return View();
    }

    [HttpGet]
    public JsonResult GetData(int id)
    {
        List&lt;Employee&gt; employees = new List&lt;Employee&gt;();
        employees.Add(new Employee{Name="Jhon"});
        employees.Add(new Employee{Name="Rick"});
        return Json(employees, JsonRequestBehavior.AllowGet);
    }
}
public class Employee
{
    public string Name { get; set; }
}
}
</code></pre>

<p>MyScript.js</p>

<pre><code>var app = angular.module("myApp", []);

app.controller("calendarDemo", function($scope) {
$scope.count = 0;
$scope.getData = function () {

    $http({ method: 'GET', url: '/Home/GetData' }).
success(function (data, status, headers, config) {
    //$scope.Employees = [{ name: 'Jhon' }, { name: 'Rick' }];
}).
error(function (data, status, headers, config) {
    alert('error');
});

}
});
</code></pre>

<p>Index.cshtml:</p>

<pre><code>@{
ViewBag.Title = "Index";
}

&lt;h2&gt;Index&lt;/h2&gt;
&lt;script src="~/Scripts/CustomScripts/MyScript.js"&gt;&lt;/script&gt;
&lt;script src="~/Scripts/moment.js"&gt;&lt;/script&gt;

&lt;link rel="stylesheet/less" type="text/css" href="~/Scripts/CustomScripts/style.less"&gt;
&lt;script src="~/Scripts/less-1.5.1.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;li ng-repeat="employee in Employees"&gt;
        {{employee.name}}
    &lt;/li&gt;
&lt;button ng-click="getData()"&gt;Get Data&lt;/button&gt;
</code></pre>