Angular 2 Duplicating the <HTML> & <HEAD> #618

Closed
opened 2025-08-09 17:16:59 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @SharePointPro on 7/1/2017

After running dotnet new angular from the Microsoft.AspNetCore.SpaTemplates::* the sample project is duplicating <html> <head> and .

The check this you can load the sample project, then press Control U in the browser.
The Snippit of the html is below (notice the duplicated elements)

<html>                        <!-- HEAD 1 -->
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Home Page - temp</title>
        <base href="/" />
        <link rel="stylesheet" href="/dist/vendor.css?v=2OSKmU2Rna58MvkZa-1vCDjb7C1cgTMqz-guh-WoUGU" />
    </head>
    <body>               <!-- BODY 1 -->
        
<app><html><head><style>@media (max-width: 767px) {    <!-- HTML 2 / HEAD 2 / APP 1 -->
    ...
@media (min-width: 768px) {..
...
}</style></head><body><app _nghost-c0="" ng-version="4.1.2"><div _ngcontent-c0=""  
class="container-fluid">   <!-- BODY 2 / APP 2 -->
    <div _ngcontent-c0="" class="row">
        <div _ngcontent-c0="" class="col-sm-3">
            <nav-menu _ngcontent-c0="" _nghost-c1=""><div _ngcontent-c1="" class="main-nav">
            </ul>
        </div>
    </div>
</div>
<script src="/dist/vendor.js?v=8G5nuphpleAMB8hDVj0v8l9es64guglhqGWIwYdey3M"></script>


        
    <script src="/dist/main-client.js?v=mDzK2Vggpkqz7CNaSstSNAR7vz3wBRBzl8SBziBUh84"></script>

    </body>
</html>

*Originally created by @SharePointPro on 7/1/2017* After running `dotnet new angular` from the `Microsoft.AspNetCore.SpaTemplates::*` the sample project is duplicating <html> <head> and <body>. The check this you can load the sample project, then press Control U in the browser. The Snippit of the html is below (notice the duplicated elements) ``` <html> <!-- HEAD 1 --> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Home Page - temp</title> <base href="/" /> <link rel="stylesheet" href="/dist/vendor.css?v=2OSKmU2Rna58MvkZa-1vCDjb7C1cgTMqz-guh-WoUGU" /> </head> <body> <!-- BODY 1 --> <app><html><head><style>@media (max-width: 767px) { <!-- HTML 2 / HEAD 2 / APP 1 --> ... @media (min-width: 768px) {.. ... }</style></head><body><app _nghost-c0="" ng-version="4.1.2"><div _ngcontent-c0="" class="container-fluid"> <!-- BODY 2 / APP 2 --> <div _ngcontent-c0="" class="row"> <div _ngcontent-c0="" class="col-sm-3"> <nav-menu _ngcontent-c0="" _nghost-c1=""><div _ngcontent-c1="" class="main-nav"> </ul> </div> </div> </div> <script src="/dist/vendor.js?v=8G5nuphpleAMB8hDVj0v8l9es64guglhqGWIwYdey3M"></script> <script src="/dist/main-client.js?v=mDzK2Vggpkqz7CNaSstSNAR7vz3wBRBzl8SBziBUh84"></script> </body> </html> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#618
No description provided.