How to: CALL ANGULAR 2 HTML/JS COMPONENT FROM ASP.NET Core CONTROLLER:
We call the HTML instead return View()
return File("~/html/About.html", "text/html");
And load angular component in the html. Here we can decide if we want to work with same or diferent module. Depends on situation.
wwwroot/html/About.html
<!DOCTYPE html>
<html>
<head>
<title>About Page</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../css/site.min.css" rel="stylesheet" type="text/css"/>
<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/systemjs/dist/system.src.js"></script>
<script src="../systemjs.config.js"></script>
<script>
System.import('../main.js').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<aboutpage>Loading AppComponent here ...</aboutpage>
</body>
</html>
(*)Already this seed needs to load the entire list of resources
How to: CALL ASP.NET Core Controller to show a MVC View with Angular2 support:
import { Component } from '@angular/core';
@Component({
selector: 'aboutpage',
templateUrl: '/home/about',
})
export class AboutComponent {
}