Angular2 Selector did not match any elements in nested Components

I fixed the issue by changing the name in the index.html, you should be sure that the tag in the index.html are the same selector that in the main component.

    <html>
      <head>
        <title>Angular 2 QuickStart</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="stylesheets/styles.css">
        <!-- 1. Load libraries -->
         <!-- Polyfill(s) for older browsers -->
        <script src="node_modules/core-js/client/shim.min.js"></script>
        <script src="node_modules/zone.js/dist/zone.js"></script>
        <script src="node_modules/reflect-metadata/Reflect.js"></script>
        <script src="node_modules/systemjs/dist/system.src.js"></script>
        <!-- 2. Configure SystemJS -->
        <script src="systemjs.config.js"></script>
        <script>
        System.import('app').catch(function(err){ console.error(err); });
        </script>
      </head>
      <!-- 3. Display the application -->

      <body>
        <my-app>Loading...</my-app> <!-- THIS TAG SHOULD BE THE SAME THAT THE SELECTOR IN THE MAIN COMPONENT -->
      </body>
    </html>

<!-- end snippet -->

  </body>
</html>

Remove bootstrap(CanvasComponent) from your CanvasComponent file. It's trying to bootstrap application second time using CanvasComponent as a root and looking for my-canvas element in your App HTML. Of course it can't find it.

Tags:

Angular