mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-25 11:07:29 +00:00
Example of using asp-prerender-data to get server-supplied data to both server and client JS
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>
|
||||
<app asp-prerender-module="ClientApp/dist/main-server"
|
||||
asp-prerender-data="new {
|
||||
IsGoldUser = true,
|
||||
Cookies = ViewContext.HttpContext.Request.Cookies
|
||||
}">Loading...</app>
|
||||
|
||||
<script src="~/dist/vendor.js" asp-append-version="true"></script>
|
||||
@section scripts {
|
||||
|
||||
Reference in New Issue
Block a user