From this thread Passing dynamic javascript values using Url.action(), how can something like that be put into a javascript file? This would be the AngularJS controller file.
From the example above, the following can be used in an AngularJS controller defined in the _Layout.cshtml script tags:
var firstname = "abc";
var username = "abcd";
location.href = '@Url.Action("Display", "Customer")?uname=' + firstname + '&name=' + username;
The issue is that the asp.net MVC code doesn't play well when put into a javascript file. It works fine when in the _Layout.cshtml script tags. But not in a JS file.