AngularJS routing not working after site hosted into IIS

前端 未结 4 900
暗喜
暗喜 2020-12-18 10:17

We are creating SPA technique using AngularJS in ASP.NET MVC framework,AngularJS routing between pages are working fine when it\'s run from VS2013,but after hosting the appl

4条回答
  •  心在旅途
    2020-12-18 11:13

    do you get any JS error when you run it on IIS?

    are you using bundles? If so check if the problem happens because of minification/bundle creation adding BundleTable.EnableOptimizations = true; in RegisterBundles method and trying again in VS.

    Otherwise I suggest you to run on local IIS (right click on project, tab "Web",section "Servers") and see if it works correctly.

    Depending of your routing you should in template head and get rid of "#" from url using $locationProvider.html5Mode(true); on route configuration.

    If none of the above are useful please add more details to your request.

    Have a nice day,

    Alberto

提交回复
热议问题