I am using [Knockoutjs](http://knockoutjs.com/) in my asp.net MVC-5 application. I have the following javascript in view:

```
<script type="text/javascript">

    var model = "@Html.Raw(Json.Encode(Model))";

    $.get("@Url.Action("_CityPartial")" ...)

    //any much more code using similar Html helpers + pure javacsript code.

</script>

```

Now i want to know, is there any way to transfer this javascript code in a separate js file (keeping Html helpers as it is).

I want to transfer javascript code to separate file because i dont want any user to check my javascript code (using chrome inspect element or any other way).

If the transfer is not possible than please let me know if there is a any way to minifiy the javascript in view itself ??