Wikipedia:Reference desk/Archives/Computing/2019 April 4

= April 4 =

ASP.NET Core and Angular
I've been told at work that the web application I've been developing in ASP.NET Core needs to use Angular for better responsiveness. I understand ASP.NET Core but I'm a complete beginner in Angular.

I've tried a simple login page where the page uses Angular to send an AJAX POST request to the ASP.NET Core controller something like this:

where the  goes to a normal ASP.NET Core controller method that returns a   containing the "you're now logged in" page. But I'm at a loss about how to show it. In the example call above,  in the   function appears to contain the rendered HTML code of the page. How do I get the  part to actually show it in the browser? J I P &#124; Talk 18:21, 4 April 2019 (UTC)


 * If I understand correctly, you want to use a string escape sequence to prevent '/' and '*' (and indeed the rest of the block comment) from being interpreted as a code comment; and to be passed through the interpreter as "plain text" and eventually output to the HTML. Syntax for this is documented in Mozilla's Javascript reference, Strings § Escape notation; or in Microsoft's CLR documentation if your ASP code is written in c or C# or similar language.
 * By its nature, this type of thing gets messy - you've potentially got comment syntax in multiple languages, with the intermediate text results potentially being parsed by multiple interpreters; so you may need one or more nested layers of escape-ment. Is there a way you can simply avoid doing this altogether?
 * Nimur (talk) 03:32, 5 April 2019 (UTC)
 * No, you don't understand me correctly. The comment is just a placeholder to use in this Wikipedia message. What I want to know is, once I get the HTML source code of the page in the  call, how do I actually display it on the page in JavaScript?  J I P  &#124; Talk 05:28, 5 April 2019 (UTC)
 * Among the options, you can write JavaScript that manipulates the final output document, using API like Document.getElementById to select what you're modifying; and write to add content. If this isn't working, we'll need to find a resource who has better expertise in the exact setup you've got, to help troubleshoot.  Nimur (talk) 15:07, 5 April 2019 (UTC)