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