Angular2 site integration in ASP.NET MVC Area

From the world of ASP.NET MVC and Angular Learning. I have an existing MVC project and I added the area that I want to be Angular2 in.

I developed the MVC project in VS 2015 and the Angular project in WebStorm. Both are executed individually, but an attempt to execute BOTH from VS 2015 is not performed for the Angular scope.

My VS 2015 project uses IIS Express.

My MVC action routes:

public ActionResult Index()
{
  return new FilePathResult("~/Areas/MyAngular/src/index.html", "text/html");
}

and produces this:

Loading...

which is index.html but Angular does not raise the ball and does not start with it?

<html>
  <body>
     <MyAngularApp>Loading...</MyAngularApp>
     <script async src="/main.bundle.js"></script>
  </body>
</html>

How can I do this integration? I suspect the problem is related to my IIS Express configuration that understands js files .... ???

+4
source share

Source: https://habr.com/ru/post/1673528/


All Articles