在asp.net核心应用程序中设置Angular 2 main.js文件的路径的位置

时间:2016-08-16 19:16:32

标签: angular asp.net-core

我有通常的wwwroot/app/main.js文件,并使用<my-app>内的选择器index.cshtml这是默认设置,可以在Views/Home中找到,一切正常。 main.js位于localhost:5000/app/main.js下,但只要我在同一.cshtml路径下的另一个Views/Home文件中使用选择器,我就会收到404错误,我看到应用程序是在localhost:5000/Home/app/main.js下寻找main.js。显然是在错误的路径中寻找文件。

我尝试更改

<script>
  System.import('app').catch(function(err){ console.error(err); });
</script>

_Layout.cshtml中找到,为它提供了main.js的完整路径,但它没有用。

0 个答案:

没有答案