Last active
September 26, 2018 17:06
-
-
Save EdCharbeneau/227f9ce51ef97596fcf204f969896d28 to your computer and use it in GitHub Desktop.
Moving JS outside of Razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
Razor things go here | |
</div> | |
@section Scripts { | |
<script src="myModule.js"></script> | |
<script> | |
myModule.init({ | |
someRoute: @Url.Action("myRoute"), | |
someSetting: @Model.SomeSettingValue | |
}) | |
</script> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment