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