我正在学习 AngularJS,但有一件事让我很恼火。
我用来$routeProvider
为我的应用程序声明路由规则:
$routeProvider.when('/test', {
controller: TestCtrl,
templateUrl: 'views/test.html'
})
.otherwise({ redirectTo: '/test' });
但是当我在浏览器中导航到我的应用程序时,我看到的app/#/test
不是app/test
.
所以我的问题是为什么 AngularJS 会将此哈希添加#
到 url 中?有没有可能避免它?