mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
refactor: prime cache formatter beautify
This commit is contained in:
@@ -50,9 +50,9 @@ namespace Microsoft.AspNetCore.AngularServices
|
||||
private static string FormatAsScript(string url, HttpStatusCode responseStatusCode, string responseBody)
|
||||
=>
|
||||
"<script>" +
|
||||
"window.__preCachedResponses = window.__preCachedResponses || {{}}; " +
|
||||
$"window.__preCachedResponses[{JsonConvert.SerializeObject(url)}] " +
|
||||
$"= {JsonConvert.SerializeObject(new { statusCode = responseStatusCode, body = responseBody })};" +
|
||||
"window.__preCachedResponses = window.__preCachedResponses || {}; " +
|
||||
$"window.__preCachedResponses[{JsonConvert.SerializeObject(url)}] " +
|
||||
$"= {JsonConvert.SerializeObject(new { statusCode = responseStatusCode, body = responseBody })};" +
|
||||
"</script>";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user