【发布时间】:2015-11-01 01:20:27
【问题描述】:
我在 ASP.NET MVC 框架中使用 AngularJS 使用 SPA 技术,当它从 VS2013 运行时,页面之间的 AngularJS 路由工作正常,但在将应用程序托管到 IIS8.5 后路由不起作用。
当我使用 IIS express 运行应用程序时,url 是 http://localhost:12345/#/home 发布后http://localhost/myapp/#/home
这是我的 app.js,
$routeProvider.when("/home", {
controller: "homeController",
templateUrl: "/app/views/home.html"
});
在index.html
<li> <a href="#/home">Home</a></li>
当我在 Windows azure 中发布我的应用程序时,应用程序运行正常。因为网址是myapp.azurewebsite.net。 myapp.azurewebsite.net/#/home
如何在本地 IIS 中进行类似的托管。
【问题讨论】: