In this simple example: https://jsfiddle.net/4hxsu4rc/2/
Is it possible to place the @Content.myVarIntoJsFile inside the js file that is included via <script src="myjs.js"></script>
?
Since it is not part of the view template associated file (_myview.cshtml), it does not work by default.
The only way I can make this work is by having the whole JS content inside the _myview.cshtml like
<script type="text/javascript">
function myfunction(myvalue) {
alert('@Content.myVarIntoJsFile' + myvalue);
}
</script>
but this makes the view template file harder to edit since the size will be considerable. How can I use @Content.field replacements in external JS files?
Best regards, João