AngularJS pass object to controller
<p>Why it's pass null in <code>model</code> variable? Where is mistake?</p>

<p><a href="https://i.stack.imgur.com/DrpWe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DrpWe.png" alt="enter image description here"></a></p>

<p>Controller:</p>

<pre><code>    [HttpGet]
    [AllowAnonymous]
    public JsonResult LoginAngular(LoginViewModel model, string returnUrl)
    {
        Console.WriteLine(model.UserName);
        return Json(model.UserName,JsonRequestBehavior.AllowGet);
    }
</code></pre>

<p>Angular:</p>

<pre><code>var login = angular.module('LoginApp', []);
login.controller('LoginCtrl', function ($scope, $http) {
    $scope.name = 'Login';
    $scope.model = { UserName: 'nothing', Password: 'nothing' };
    $scope.model.UserName = "Test";
    $scope.model.Password = 'Test';
    $scope.returnUrl = '/Account/TestLogin';

    $scope.onClick = function () {
        console.log($scope.model);
        $http({
            method: 'GET',
            url: '/Account/LoginAngular',
            params: { model: $scope.model, returnUrl: $scope.returnUrl }
        }).success(function (response) {
            console.log(response);
        });
    };
});
</code></pre>