Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
脱机html5模式AngularJS与Workbox ServiceWorker_Angularjs_Html_Offline_Workbox - Fatal编程技术网

脱机html5模式AngularJS与Workbox ServiceWorker

脱机html5模式AngularJS与Workbox ServiceWorker,angularjs,html,offline,workbox,Angularjs,Html,Offline,Workbox,我们有一个angularjs应用程序,该应用程序与nodejs一起提供,并为serviceworker提供了workbox。即使在脱机状态下(在终止node-express时),哈希版本也可以正常工作。假设我们有这个url http://localhost:3000/#/form/1 当其脱机或节点未运行时,它仍然加载页面,因为它是由serviceworker缓存的 我们决定不再使用散列并切换到html5模式,现在我们有了它,而不是散列url http://localhost:3000/for

我们有一个angularjs应用程序,该应用程序与nodejs一起提供,并为serviceworker提供了workbox。即使在脱机状态下(在终止node-express时),哈希版本也可以正常工作。假设我们有这个url

http://localhost:3000/#/form/1
当其脱机或节点未运行时,它仍然加载页面,因为它是由serviceworker缓存的

我们决定不再使用散列并切换到html5模式,现在我们有了它,而不是散列url

http://localhost:3000/form/1
如果直接浏览或重新加载,此url将不起作用,只有从根目录单击时才起作用

http://localhost:3000
这是AngularJS的问题吗?工作箱?或者这是一种预期的行为? 谢谢

**更新** 这与我们已经用express解决的问题不同:

app.get('*',函数(req,res,next){
res.sendfile('./server/public/index.html');


错误是当它离线时。

你设置了基本路径吗?是的,它对你有用吗?我们有一个传统的angularjs应用程序,我们需要将其转换为PWA。我在做一些研究,发现