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