0
ルートの$locationProvider.html5Mode(true);
および<base href="/" />
を有効にした後、手動リロード後にクラッシュが開始されました。
ソリューションを探す私は、.htaccess
のルールがこの問題を解決することがわかりましたが、さまざまな設定は役に立ちませんでした。
私index.html
はサブディレクトリに/views/index.html
.htaccess
あるので、多分これは、次のとおりです。
Options +FollowSymLinks
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L] # /views/index.html doesn't work as well
</ifModule>
route config
app.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {
templateUrl: 'home.html',
controller: 'AddTaskCtrl',
controllerAs: 'AddTask'
})
.when('/chat', { //this route breaks on manual refresh
templateUrl: 'chat.html',
controller: 'ChatCtrl',
controllerAs: 'chat'
})
}]);
を見ているときに、あなたのFAQへのリンクは非常に役に立ちました。ありがとうございました – lomboboo