符号“!”的含义使用 ui-route angular js 时在 URL 内

Meaning of the symbol "!" inside URL when using ui-route angular js

我是js新手,我跟着这个example研究如何在SPA中用angularjs路由UI。
当我下载运行这个例子时,URL是

"http://localhost:8080/#/home" 

但是当我开始自己创建样本时,URL 始终是

"http://localhost:8080/#!/home"

我不知道 "!" 符号在 URL 中的含义。我的示例仍然有效,但“!”在 URL 里面让我感到困惑,我想知道 "something was missing, isn't it?" 请教我或给我一些关键字以更深入地了解问题。 谢谢

It is called Fragment_identifier


$location 服务旨在支持哈希前缀 URL 对于浏览器不支持 HTML5 push-state 导航的情况。

Google Ajax 爬网方案期望 SPA 中的本地路径开始 使用 hash-bang(例如 somedomain.com/base/path/#!/client/side/path)。

$locationProvide 允许应用程序开发人员配置 hashPrefix,将其设置为一个爆炸“!”是正常的,但默认 一直是空字符串 ''.

这造成了一些用户不知道此功能的混乱 并想知道为什么要向该位置添加哈希值(例如 $location.hash('xxx')) 产生双重散列:##xxx.

这次提交将前缀的默认值更改为'!',这更 自然而然。

https://developers.google.com/webmasters/ajax-crawling/docs/getting-started

Referred from

请访问这里: