D
D
Dmitry Gavrilenko2016-10-31 19:04:59
ASP.NET
Dmitry Gavrilenko, 2016-10-31 19:04:59

How to host Angular 2 on ASP?

The project is based on pure ASP MVC and pure Angular 2 (cli). Clean - that is, there are no my files. Only settings. If I run it through ng serve , then everything is ok, Angular works. If I host ASP, then I get a page with Loading... The necessary files are not loaded.
Actually it is understandable, links are clearly not indicated

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Wwwroot</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
  <app-root>Loading...</app-root>
</body>
</html>

But ng serve somehow loads them... And I don't think that Angular 2 can host only for this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Gavrilenko, 2016-10-31
@Maddox

By default, the files to run are in the dist folder. Its content must be hosted. If the folder is empty, then you need to run ng build. ng build -prod - for release project

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question