【发布时间】:2013-02-21 09:44:27
【问题描述】:
我的$routeProvider 是这样配置的:
teachApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.
when('/teach/', {templateUrl: 'views/login_view.html'}).
when('/teach/overview', {templateUrl: 'views/overview_view.html'}).
when('/teach/users', {templateUrl: 'views/users_view.html'}).
otherwise({redirectTo: '/teach/'});
$locationProvider.html5Mode(true);
}]);
在应用程序中,如果我单击 <a href="/teach/overview">Overview</a> 之类的链接,概览部分将按预期显示。但是,当我手动将地址栏中的 URL 更改为完全相同的 URL 时,我收到 404 错误。 $routeProvider 是否配置错误?
我正在使用 MAMP localhost,应用的根 url 为 http://localhost/teach/
【问题讨论】: