我想知道有人可以帮助我与我的Angular项目。 我希望能够使用路由。问题是我创建的所有链接都指向localhost/something。即使我将base标签放在index.html中,它也不起作用。角路由断开链接
的basetag看起来是这样的:
<base href="/routing/"></base>
的app.js看起来是这样的:
$routeProvider. when('/', { templateUrl: 'partials/home.html' }). when('/next', { templateUrl: 'partials/next.html' }). otherwise({ redirectTo: '/' }); $locationProvider.html5Mode({ enabled: true, requireBase: false });
与家用模板看起来是这样的:
<h1>Home Template</h1> <a href="/next">Next</a>
我该如何解决这个问题?
Finaly发现在链接应该是这样的:Next – user3519221