Javascript AngularJs在页面刷新时仅加载部分(dashboard.html)
我有一个angualrJs应用程序,我在其中启用了HTML5模式true,并在服务器端应用了所需的设置 .htaccess文件Javascript AngularJs在页面刷新时仅加载部分(dashboard.html),javascript,jquery,html,angularjs,.htaccess,Javascript,Jquery,Html,Angularjs,.htaccess,我有一个angualrJs应用程序,我在其中启用了HTML5模式true,并在服务器端应用了所需的设置 .htaccess文件 DirectoryIndex index.html RewriteEngine on RewriteBase /timeLeap/ RewriteCond $1 !^(index\.html|images|css|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond
DirectoryIndex index.html
RewriteEngine on
RewriteBase /timeLeap/
RewriteCond $1 !^(index\.html|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.html [NC,L]
我还插入了
和$locationProvider.html5Mode(true)代码>
现在,当我尝试刷新任何状态的页面时,它只加载该状态的模板,并且不会应用angular
URL:http://localhost/app/data1
响应:仅状态加载普通data1.html文件,无角度影响
注意:
但若我修改url并这样做,它会按预期加载data1状态
URL:http://localhost/app/#data1
答复:工作如期进行
所以如果有人有想法,请告诉我